@@ -307,6 +307,16 @@ <h2 id="decl-matchers">Node Matchers</h2>
307
307
</ pre > </ td > </ tr >
308
308
309
309
310
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > ></ td > < td class ="name " onclick ="toggle('typedefDecl0') "> < a name ="typedefDecl0Anchor "> typedefDecl</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypedefDecl.html "> TypedefDecl</ a > >...</ td > </ tr >
311
+ < tr > < td colspan ="4 " class ="doc " id ="typedefDecl0 "> < pre > Matches typedef declarations.
312
+
313
+ Given
314
+ typedef int X;
315
+ typedefDecl()
316
+ matches "typedef int X"
317
+ </ pre > </ td > </ tr >
318
+
319
+
310
320
< tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > ></ td > < td class ="name " onclick ="toggle('unresolvedUsingValueDecl0') "> < a name ="unresolvedUsingValueDecl0Anchor "> unresolvedUsingValueDecl</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingValueDecl.html "> UnresolvedUsingValueDecl</ a > >...</ td > </ tr >
311
321
< tr > < td colspan ="4 " class ="doc " id ="unresolvedUsingValueDecl0 "> < pre > Matches unresolved using value declarations.
312
322
@@ -339,6 +349,15 @@ <h2 id="decl-matchers">Node Matchers</h2>
339
349
matches using namespace X </ pre > </ td > </ tr >
340
350
341
351
352
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > ></ td > < td class ="name " onclick ="toggle('valueDecl0') "> < a name ="valueDecl0Anchor "> valueDecl</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html "> ValueDecl</ a > >...</ td > </ tr >
353
+ < tr > < td colspan ="4 " class ="doc " id ="valueDecl0 "> < pre > Matches any value declaration.
354
+
355
+ Example matches A, B, C and F
356
+ enum X { A, B, C };
357
+ void F();
358
+ </ pre > </ td > </ tr >
359
+
360
+
342
361
< tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > ></ td > < td class ="name " onclick ="toggle('varDecl0') "> < a name ="varDecl0Anchor "> varDecl</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html "> VarDecl</ a > >...</ td > </ tr >
343
362
< tr > < td colspan ="4 " class ="doc " id ="varDecl0 "> < pre > Matches variable declarations.
344
363
@@ -1654,6 +1673,48 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
1654
1673
</ pre > </ td > </ tr >
1655
1674
1656
1675
1676
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > ></ td > < td class ="name " onclick ="toggle('isExpansionInFileMatching0') "> < a name ="isExpansionInFileMatching0Anchor "> isExpansionInFileMatching</ a > </ td > < td > std::string RegExp</ td > </ tr >
1677
+ < tr > < td colspan ="4 " class ="doc " id ="isExpansionInFileMatching0 "> < pre > Matches AST nodes that were expanded within files whose name is
1678
+ partially matching a given regex.
1679
+
1680
+ Example matches Y but not X
1681
+ (matcher = recordDecl(isExpansionInFileMatching("AST.*"))
1682
+ #include "ASTMatcher.h"
1683
+ class X {};
1684
+ ASTMatcher.h:
1685
+ class Y {};
1686
+
1687
+ Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > >
1688
+ </ pre > </ td > </ tr >
1689
+
1690
+
1691
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > ></ td > < td class ="name " onclick ="toggle('isExpansionInMainFile0') "> < a name ="isExpansionInMainFile0Anchor "> isExpansionInMainFile</ a > </ td > < td > </ td > </ tr >
1692
+ < tr > < td colspan ="4 " class ="doc " id ="isExpansionInMainFile0 "> < pre > Matches AST nodes that were expanded within the main-file.
1693
+
1694
+ Example matches X but not Y (matcher = recordDecl(isExpansionInMainFile())
1695
+ #include <Y.h>
1696
+ class X {};
1697
+ Y.h:
1698
+ class Y {};
1699
+
1700
+ Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > >
1701
+ </ pre > </ td > </ tr >
1702
+
1703
+
1704
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > ></ td > < td class ="name " onclick ="toggle('isExpansionInSystemHeader0') "> < a name ="isExpansionInSystemHeader0Anchor "> isExpansionInSystemHeader</ a > </ td > < td > </ td > </ tr >
1705
+ < tr > < td colspan ="4 " class ="doc " id ="isExpansionInSystemHeader0 "> < pre > Matches AST nodes that were expanded within system-header-files.
1706
+
1707
+ Example matches Y but not X
1708
+ (matcher = recordDecl(isExpansionInSystemHeader())
1709
+ #include <SystemHeader.h>
1710
+ class X {};
1711
+ SystemHeader.h:
1712
+ class Y {};
1713
+
1714
+ Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > >
1715
+ </ pre > </ td > </ tr >
1716
+
1717
+
1657
1718
< tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > ></ td > < td class ="name " onclick ="toggle('isImplicit0') "> < a name ="isImplicit0Anchor "> isImplicit</ a > </ td > < td > </ td > </ tr >
1658
1719
< tr > < td colspan ="4 " class ="doc " id ="isImplicit0 "> < pre > Matches a declaration that has been implicitly added
1659
1720
by the compiler (eg. implicit defaultcopy constructors).
@@ -1858,7 +1919,7 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
1858
1919
</ pre > </ td > </ tr >
1859
1920
1860
1921
1861
- < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html "> NamedDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasName0') "> < a name ="hasName0Anchor "> hasName</ a > </ td > < td > std::string Name</ td > </ tr >
1922
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html "> NamedDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasName0') "> < a name ="hasName0Anchor "> hasName</ a > </ td > < td > std::string Name</ td > </ tr >
1862
1923
< tr > < td colspan ="4 " class ="doc " id ="hasName0 "> < pre > Matches NamedDecl nodes that have the specified name.
1863
1924
1864
1925
Supports specifying enclosing namespaces or classes by prefixing the name
@@ -1990,6 +2051,48 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
1990
2051
</ pre > </ td > </ tr >
1991
2052
1992
2053
2054
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > ></ td > < td class ="name " onclick ="toggle('isExpansionInFileMatching1') "> < a name ="isExpansionInFileMatching1Anchor "> isExpansionInFileMatching</ a > </ td > < td > std::string RegExp</ td > </ tr >
2055
+ < tr > < td colspan ="4 " class ="doc " id ="isExpansionInFileMatching1 "> < pre > Matches AST nodes that were expanded within files whose name is
2056
+ partially matching a given regex.
2057
+
2058
+ Example matches Y but not X
2059
+ (matcher = recordDecl(isExpansionInFileMatching("AST.*"))
2060
+ #include "ASTMatcher.h"
2061
+ class X {};
2062
+ ASTMatcher.h:
2063
+ class Y {};
2064
+
2065
+ Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > >
2066
+ </ pre > </ td > </ tr >
2067
+
2068
+
2069
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > ></ td > < td class ="name " onclick ="toggle('isExpansionInMainFile1') "> < a name ="isExpansionInMainFile1Anchor "> isExpansionInMainFile</ a > </ td > < td > </ td > </ tr >
2070
+ < tr > < td colspan ="4 " class ="doc " id ="isExpansionInMainFile1 "> < pre > Matches AST nodes that were expanded within the main-file.
2071
+
2072
+ Example matches X but not Y (matcher = recordDecl(isExpansionInMainFile())
2073
+ #include <Y.h>
2074
+ class X {};
2075
+ Y.h:
2076
+ class Y {};
2077
+
2078
+ Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > >
2079
+ </ pre > </ td > </ tr >
2080
+
2081
+
2082
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > ></ td > < td class ="name " onclick ="toggle('isExpansionInSystemHeader1') "> < a name ="isExpansionInSystemHeader1Anchor "> isExpansionInSystemHeader</ a > </ td > < td > </ td > </ tr >
2083
+ < tr > < td colspan ="4 " class ="doc " id ="isExpansionInSystemHeader1 "> < pre > Matches AST nodes that were expanded within system-header-files.
2084
+
2085
+ Example matches Y but not X
2086
+ (matcher = recordDecl(isExpansionInSystemHeader())
2087
+ #include <SystemHeader.h>
2088
+ class X {};
2089
+ SystemHeader.h:
2090
+ class Y {};
2091
+
2092
+ Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > >
2093
+ </ pre > </ td > </ tr >
2094
+
2095
+
1993
2096
< tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > ></ td > < td class ="name " onclick ="toggle('isInTemplateInstantiation0') "> < a name ="isInTemplateInstantiation0Anchor "> isInTemplateInstantiation</ a > </ td > < td > </ td > </ tr >
1994
2097
< tr > < td colspan ="4 " class ="doc " id ="isInTemplateInstantiation0 "> < pre > Matches statements inside of a template instantiation.
1995
2098
@@ -2061,6 +2164,48 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
2061
2164
</ pre > </ td > </ tr >
2062
2165
2063
2166
2167
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > ></ td > < td class ="name " onclick ="toggle('isExpansionInFileMatching2') "> < a name ="isExpansionInFileMatching2Anchor "> isExpansionInFileMatching</ a > </ td > < td > std::string RegExp</ td > </ tr >
2168
+ < tr > < td colspan ="4 " class ="doc " id ="isExpansionInFileMatching2 "> < pre > Matches AST nodes that were expanded within files whose name is
2169
+ partially matching a given regex.
2170
+
2171
+ Example matches Y but not X
2172
+ (matcher = recordDecl(isExpansionInFileMatching("AST.*"))
2173
+ #include "ASTMatcher.h"
2174
+ class X {};
2175
+ ASTMatcher.h:
2176
+ class Y {};
2177
+
2178
+ Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > >
2179
+ </ pre > </ td > </ tr >
2180
+
2181
+
2182
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > ></ td > < td class ="name " onclick ="toggle('isExpansionInMainFile2') "> < a name ="isExpansionInMainFile2Anchor "> isExpansionInMainFile</ a > </ td > < td > </ td > </ tr >
2183
+ < tr > < td colspan ="4 " class ="doc " id ="isExpansionInMainFile2 "> < pre > Matches AST nodes that were expanded within the main-file.
2184
+
2185
+ Example matches X but not Y (matcher = recordDecl(isExpansionInMainFile())
2186
+ #include <Y.h>
2187
+ class X {};
2188
+ Y.h:
2189
+ class Y {};
2190
+
2191
+ Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > >
2192
+ </ pre > </ td > </ tr >
2193
+
2194
+
2195
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > ></ td > < td class ="name " onclick ="toggle('isExpansionInSystemHeader2') "> < a name ="isExpansionInSystemHeader2Anchor "> isExpansionInSystemHeader</ a > </ td > < td > </ td > </ tr >
2196
+ < tr > < td colspan ="4 " class ="doc " id ="isExpansionInSystemHeader2 "> < pre > Matches AST nodes that were expanded within system-header-files.
2197
+
2198
+ Example matches Y but not X
2199
+ (matcher = recordDecl(isExpansionInSystemHeader())
2200
+ #include <SystemHeader.h>
2201
+ class X {};
2202
+ SystemHeader.h:
2203
+ class Y {};
2204
+
2205
+ Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > >
2206
+ </ pre > </ td > </ tr >
2207
+
2208
+
2064
2209
< tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Type.html "> Type</ a > ></ td > < td class ="name " onclick ="toggle('equalsBoundNode2') "> < a name ="equalsBoundNode2Anchor "> equalsBoundNode</ a > </ td > < td > std::string ID</ td > </ tr >
2065
2210
< tr > < td colspan ="4 " class ="doc " id ="equalsBoundNode2 "> < pre > Matches if a node equals a previously bound node.
2066
2211
0 commit comments