@@ -2948,6 +2948,19 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
2948
2948
</ pre > </ td > </ tr >
2949
2949
2950
2950
2951
+ < tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > ></ td > < td class ="name " onclick ="toggle('isInstantiated0') "> < a name ="isInstantiated0Anchor "> isInstantiated</ a > </ td > < td > </ td > </ tr >
2952
+ < tr > < td colspan ="4 " class ="doc " id ="isInstantiated0 "> < pre > Matches declarations that are template instantiations or are inside
2953
+ template instantiations.
2954
+
2955
+ Given
2956
+ template<typename T> void A(T t) { T i; }
2957
+ A(0);
2958
+ A(0U);
2959
+ functionDecl(isInstantiated())
2960
+ matches 'A(int) {...};' and 'A(unsigned) {...}'.
2961
+ </ pre > </ td > </ tr >
2962
+
2963
+
2951
2964
< tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > ></ td > < td class ="name " onclick ="toggle('isPrivate0') "> < a name ="isPrivate0Anchor "> isPrivate</ a > </ td > < td > </ td > </ tr >
2952
2965
< tr > < td colspan ="4 " class ="doc " id ="isPrivate0 "> < pre > Matches private C++ declarations.
2953
2966
@@ -3516,6 +3529,16 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
3516
3529
</ pre > </ td > </ tr >
3517
3530
3518
3531
3532
+ < tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html "> NamedDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasAnyName0') "> < a name ="hasAnyName0Anchor "> hasAnyName</ a > </ td > < td > StringRef, ..., StringRef</ td > </ tr >
3533
+ < tr > < td colspan ="4 " class ="doc " id ="hasAnyName0 "> < pre > Matches NamedDecl nodes that have any of the specified names.
3534
+
3535
+ This matcher is only provided as a performance optimization of hasName.
3536
+ hasAnyName(a, b, c)
3537
+ is equivalent to, but faster than
3538
+ anyOf(hasName(a), hasName(b), hasName(c))
3539
+ </ pre > </ td > </ tr >
3540
+
3541
+
3519
3542
< tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html "> NamedDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasExternalFormalLinkage0') "> < a name ="hasExternalFormalLinkage0Anchor "> hasExternalFormalLinkage</ a > </ td > < td > </ td > </ tr >
3520
3543
< tr > < td colspan ="4 " class ="doc " id ="hasExternalFormalLinkage0 "> < pre > Matches a declaration that has external formal linkage.
3521
3544
@@ -3679,6 +3702,17 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
3679
3702
</ pre > </ td > </ tr >
3680
3703
3681
3704
3705
+ < tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html "> ObjCMessageExpr</ a > ></ td > < td class ="name " onclick ="toggle('hasAnySelector0') "> < a name ="hasAnySelector0Anchor "> hasAnySelector</ a > </ td > < td > StringRef, ..., StringRef</ td > </ tr >
3706
+ < tr > < td colspan ="4 " class ="doc " id ="hasAnySelector0 "> < pre > Matches when at least one of the supplied string equals to the
3707
+ Selector.getAsString()
3708
+
3709
+ matcher = objCMessageExpr(hasSelector("methodA:", "methodB:"));
3710
+ matches both of the expressions below:
3711
+ [myObj methodA:argA];
3712
+ [myObj methodB:argB];
3713
+ </ pre > </ td > </ tr >
3714
+
3715
+
3682
3716
< tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html "> ObjCMessageExpr</ a > ></ td > < td class ="name " onclick ="toggle('hasKeywordSelector0') "> < a name ="hasKeywordSelector0Anchor "> hasKeywordSelector</ a > </ td > < td > </ td > </ tr >
3683
3717
< tr > < td colspan ="4 " class ="doc " id ="hasKeywordSelector0 "> < pre > Matches when the selector is a keyword selector
3684
3718
@@ -4015,6 +4049,17 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
4015
4049
</ pre > </ td > </ tr >
4016
4050
4017
4051
4052
+ < tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > ></ td > < td class ="name " onclick ="toggle('isExpandedFromMacro0') "> < a name ="isExpandedFromMacro0Anchor "> isExpandedFromMacro</ a > </ td > < td > llvm::StringRef MacroName</ td > </ tr >
4053
+ < tr > < td colspan ="4 " class ="doc " id ="isExpandedFromMacro0 "> < pre > Matches statements that are (transitively) expanded from the named macro.
4054
+ Does not match if only part of the statement is expanded from that macro or
4055
+ if different parts of the the statement are expanded from different
4056
+ appearances of the macro.
4057
+
4058
+ FIXME: Change to be a polymorphic matcher that works on any syntactic
4059
+ node. There's nothing `Stmt`-specific about it.
4060
+ </ pre > </ td > </ tr >
4061
+
4062
+
4018
4063
< tr > < td > Matcher<< a href ="https://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 >
4019
4064
< tr > < td colspan ="4 " class ="doc " id ="isExpansionInFileMatching1 "> < pre > Matches AST nodes that were expanded within files whose name is
4020
4065
partially matching a given regex.
@@ -4058,6 +4103,22 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
4058
4103
</ pre > </ td > </ tr >
4059
4104
4060
4105
4106
+ < tr > < td > Matcher<< a href ="https://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 >
4107
+ < tr > < td colspan ="4 " class ="doc " id ="isInTemplateInstantiation0 "> < pre > Matches statements inside of a template instantiation.
4108
+
4109
+ Given
4110
+ int j;
4111
+ template<typename T> void A(T t) { T i; j += 42;}
4112
+ A(0);
4113
+ A(0U);
4114
+ declStmt(isInTemplateInstantiation())
4115
+ matches 'int i;' and 'unsigned i'.
4116
+ unless(stmt(isInTemplateInstantiation()))
4117
+ will NOT match j += 42; as it's shared between the template definition and
4118
+ instantiation.
4119
+ </ pre > </ td > </ tr >
4120
+
4121
+
4061
4122
< tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > ></ td > < td class ="name " onclick ="toggle('isOMPStructuredBlock0') "> < a name ="isOMPStructuredBlock0Anchor "> isOMPStructuredBlock</ a > </ td > < td > </ td > </ tr >
4062
4123
< tr > < td colspan ="4 " class ="doc " id ="isOMPStructuredBlock0 "> < pre > Matches the Stmt AST node that is marked as being the structured-block
4063
4124
of an OpenMP executable directive.
@@ -4551,56 +4612,6 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
4551
4612
Usable as: Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html "> FunctionDecl</ a > >, Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1VarDecl.html "> VarDecl</ a > >, Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html "> CXXRecordDecl</ a > >
4552
4613
</ pre > </ td > </ tr >
4553
4614
4554
-
4555
- < tr > < td > Matcher<internal::Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > >></ td > < td class ="name " onclick ="toggle('isInstantiated0') "> < a name ="isInstantiated0Anchor "> isInstantiated</ a > </ td > < td > </ td > </ tr >
4556
- < tr > < td colspan ="4 " class ="doc " id ="isInstantiated0 "> < pre > Matches declarations that are template instantiations or are inside
4557
- template instantiations.
4558
-
4559
- Given
4560
- template<typename T> void A(T t) { T i; }
4561
- A(0);
4562
- A(0U);
4563
- functionDecl(isInstantiated())
4564
- matches 'A(int) {...};' and 'A(unsigned) {...}'.
4565
- </ pre > </ td > </ tr >
4566
-
4567
-
4568
- < tr > < td > Matcher<internal::Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html "> NamedDecl</ a > >></ td > < td class ="name " onclick ="toggle('hasAnyName0') "> < a name ="hasAnyName0Anchor "> hasAnyName</ a > </ td > < td > StringRef, ..., StringRef</ td > </ tr >
4569
- < tr > < td colspan ="4 " class ="doc " id ="hasAnyName0 "> < pre > Matches NamedDecl nodes that have any of the specified names.
4570
-
4571
- This matcher is only provided as a performance optimization of hasName.
4572
- hasAnyName(a, b, c)
4573
- is equivalent to, but faster than
4574
- anyOf(hasName(a), hasName(b), hasName(c))
4575
- </ pre > </ td > </ tr >
4576
-
4577
-
4578
- < tr > < td > Matcher<internal::Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html "> ObjCMessageExpr</ a > >></ td > < td class ="name " onclick ="toggle('hasAnySelector0') "> < a name ="hasAnySelector0Anchor "> hasAnySelector</ a > </ td > < td > StringRef, ..., StringRef</ td > </ tr >
4579
- < tr > < td colspan ="4 " class ="doc " id ="hasAnySelector0 "> < pre > Matches when at least one of the supplied string equals to the
4580
- Selector.getAsString()
4581
-
4582
- matcher = objCMessageExpr(hasSelector("methodA:", "methodB:"));
4583
- matches both of the expressions below:
4584
- [myObj methodA:argA];
4585
- [myObj methodB:argB];
4586
- </ pre > </ td > </ tr >
4587
-
4588
-
4589
- < tr > < td > Matcher<internal::Matcher<< a href ="https://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 >
4590
- < tr > < td colspan ="4 " class ="doc " id ="isInTemplateInstantiation0 "> < pre > Matches statements inside of a template instantiation.
4591
-
4592
- Given
4593
- int j;
4594
- template<typename T> void A(T t) { T i; j += 42;}
4595
- A(0);
4596
- A(0U);
4597
- declStmt(isInTemplateInstantiation())
4598
- matches 'int i;' and 'unsigned i'.
4599
- unless(stmt(isInTemplateInstantiation()))
4600
- will NOT match j += 42; as it's shared between the template definition and
4601
- instantiation.
4602
- </ pre > </ td > </ tr >
4603
-
4604
4615
<!--END_NARROWING_MATCHERS -->
4605
4616
</ table >
4606
4617
@@ -6600,6 +6611,12 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
6600
6611
</ pre > </ td > </ tr >
6601
6612
6602
6613
6614
+ < tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html "> NestedNameSpecifierLoc</ a > ></ td > < td class ="name " onclick ="toggle('loc1') "> < a name ="loc1Anchor "> loc</ a > </ td > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html "> NestedNameSpecifier</ a > > InnerMatcher</ td > </ tr >
6615
+ < tr > < td colspan ="4 " class ="doc " id ="loc1 "> < pre > Matches NestedNameSpecifierLocs for which the given inner
6616
+ NestedNameSpecifier-matcher matches.
6617
+ </ pre > </ td > </ tr >
6618
+
6619
+
6603
6620
< tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html "> NestedNameSpecifierLoc</ a > ></ td > < td class ="name " onclick ="toggle('specifiesTypeLoc0') "> < a name ="specifiesTypeLoc0Anchor "> specifiesTypeLoc</ a > </ td > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > > InnerMatcher</ td > </ tr >
6604
6621
< tr > < td colspan ="4 " class ="doc " id ="specifiesTypeLoc0 "> < pre > Matches nested name specifier locs that specify a type matching the
6605
6622
given TypeLoc.
@@ -7401,6 +7418,12 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
7401
7418
</ pre > </ td > </ tr >
7402
7419
7403
7420
7421
+ < tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > ></ td > < td class ="name " onclick ="toggle('loc0') "> < a name ="loc0Anchor "> loc</ a > </ td > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1QualType.html "> QualType</ a > > InnerMatcher</ td > </ tr >
7422
+ < tr > < td colspan ="4 " class ="doc " id ="loc0 "> < pre > Matches TypeLocs for which the given inner
7423
+ QualType-matcher matches.
7424
+ </ pre > </ td > </ tr >
7425
+
7426
+
7404
7427
< tr > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1TypedefNameDecl.html "> TypedefNameDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasType2') "> < a name ="hasType2Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1QualType.html "> QualType</ a > > InnerMatcher</ td > </ tr >
7405
7428
< tr > < td colspan ="4 " class ="doc " id ="hasType2 "> < pre > Matches if the expression's or declaration's type matches a type
7406
7429
matcher.
@@ -7636,18 +7659,6 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
7636
7659
if (true) {}
7637
7660
</ pre > </ td > </ tr >
7638
7661
7639
-
7640
- < tr > < td > Matcher<internal::BindableMatcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html "> NestedNameSpecifierLoc</ a > >></ td > < td class ="name " onclick ="toggle('loc1') "> < a name ="loc1Anchor "> loc</ a > </ td > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html "> NestedNameSpecifier</ a > > InnerMatcher</ td > </ tr >
7641
- < tr > < td colspan ="4 " class ="doc " id ="loc1 "> < pre > Matches NestedNameSpecifierLocs for which the given inner
7642
- NestedNameSpecifier-matcher matches.
7643
- </ pre > </ td > </ tr >
7644
-
7645
-
7646
- < tr > < td > Matcher<internal::BindableMatcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html "> TypeLoc</ a > >></ td > < td class ="name " onclick ="toggle('loc0') "> < a name ="loc0Anchor "> loc</ a > </ td > < td > Matcher<< a href ="https://clang.llvm.org/doxygen/classclang_1_1QualType.html "> QualType</ a > > InnerMatcher</ td > </ tr >
7647
- < tr > < td colspan ="4 " class ="doc " id ="loc0 "> < pre > Matches TypeLocs for which the given inner
7648
- QualType-matcher matches.
7649
- </ pre > </ td > </ tr >
7650
-
7651
7662
<!--END_TRAVERSAL_MATCHERS -->
7652
7663
</ table >
7653
7664
0 commit comments