From 5e20cdd81c44a443562a09007668ffdf76c455af Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 27 May 2015 18:47:56 +0000 Subject: Vendor import of clang trunk r238337: https://llvm.org/svn/llvm-project/cfe/trunk@238337 --- docs/LibASTMatchersReference.html | 85 +++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 31 deletions(-) (limited to 'docs/LibASTMatchersReference.html') diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index e70d1ec3fac7..74bbf9e47334 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -307,6 +307,19 @@ Example matches X, Z +Matcher<Decl>translationUnitDeclMatcher<TranslationUnitDecl>... +
Matches the top declaration context.
+
+Given
+  int X;
+  namespace NS {
+  int Y;
+  }  namespace NS
+decl(hasDeclContext(translationUnitDecl()))
+  matches "int X", but not "int Y".
+
+ + Matcher<Decl>typedefDeclMatcher<TypedefDecl>...
Matches typedef declarations.
 
@@ -1525,7 +1538,7 @@ Usable as: Matcher<CXXRecordDecl>isDerivedFromStringRef BaseName
+Matcher<CXXRecordDecl>isDerivedFromstd::string BaseName
 
Overloaded method as shortcut for isDerivedFrom(hasName(...)).
 
@@ -1544,7 +1557,7 @@ Usable as: Matcher<CXXRecordDecl>isSameOrDerivedFromStringRef BaseName +Matcher<CXXRecordDecl>isSameOrDerivedFromstd::string BaseName
Overloaded method as shortcut for
 isSameOrDerivedFrom(hasName(...)).
 
@@ -1721,19 +1734,6 @@ by the compiler (eg. implicit defaultcopy constructors).
-Matcher<Decl>isInstantiated -
Matches declarations that are template instantiations or are inside
-template instantiations.
-
-Given
-  template<typename T> void A(T t) { T i; }
-  A(0);
-  A(0U);
-functionDecl(isInstantiated())
-  matches 'A(int) {...};' and 'A(unsigned) {...}'.
-
- - Matcher<Decl>isPrivate
Matches private C++ declarations.
 
@@ -2093,22 +2093,6 @@ Usable as: Matcher<Stmt>isInTemplateInstantiation
-
Matches statements inside of a template instantiation.
-
-Given
-  int j;
-  template<typename T> void A(T t) { T i; j += 42;}
-  A(0);
-  A(0U);
-declStmt(isInTemplateInstantiation())
-  matches 'int i;' and 'unsigned i'.
-unless(stmt(isInTemplateInstantiation()))
-  will NOT match j += 42; as it's shared between the template definition and
-  instantiation.
-
- - Matcher<TagDecl>isDefinition
Matches if a declaration has a body attached.
 
@@ -2229,6 +2213,16 @@ and reference to that variable declaration within a compound statement.
 
+Matcher<Type>voidType +
Matches type void.
+
+Given
+ struct S { void func(); };
+functionDecl(returns(voidType()))
+  matches "void func();"
+
+ + Matcher<UnaryExprOrTypeTraitExpr>ofKindUnaryExprOrTypeTrait Kind
Matches unary expressions of a certain kind.
 
@@ -2323,6 +2317,35 @@ recordDecl(hasName("::X"), isTemplateInstantiation())
 Usable as: Matcher<FunctionDecl>, Matcher<VarDecl>, Matcher<CXXRecordDecl>
 
+ +Matcher<internal::Matcher<Decl>>isInstantiated +
Matches declarations that are template instantiations or are inside
+template instantiations.
+
+Given
+  template<typename T> void A(T t) { T i; }
+  A(0);
+  A(0U);
+functionDecl(isInstantiated())
+  matches 'A(int) {...};' and 'A(unsigned) {...}'.
+
+ + +Matcher<internal::Matcher<Stmt>>isInTemplateInstantiation +
Matches statements inside of a template instantiation.
+
+Given
+  int j;
+  template<typename T> void A(T t) { T i; j += 42;}
+  A(0);
+  A(0U);
+declStmt(isInTemplateInstantiation())
+  matches 'int i;' and 'unsigned i'.
+unless(stmt(isInTemplateInstantiation()))
+  will NOT match j += 42; as it's shared between the template definition and
+  instantiation.
+
+ -- cgit v1.3