From: YangZhihui Date: Wed, 23 Sep 2020 13:08:14 +0000 (-0400) Subject: Fix typos in ASTMatchers.h; NFC X-Git-Tag: llvmorg-13-init~11185 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d1c382ed221f378fc866a524c7c673c239e94bc;p=platform%2Fupstream%2Fllvm.git Fix typos in ASTMatchers.h; NFC --- diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index c4c6de1..fd8b217 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -516,6 +516,16 @@ Example matches X, Z, U, S, E +Matcher<Decl>templateTemplateParmDeclMatcher<TemplateTemplateParmDecl>... +
Matches template template parameter declarations.
+
+Given
+  template <template <typename> class Z, int N> struct C {};
+templateTypeParmDecl()
+  matches 'Z', but not 'N'.
+
+ + Matcher<Decl>templateTypeParmDeclMatcher<TemplateTypeParmDecl>...
Matches template type parameter declarations.
 
@@ -661,18 +671,6 @@ number.
 
-Matcher<DecompositionDecl>decompositionDeclMatcher<DecompositionDecl>... -
Matches decomposition-declarations.
-
-Examples matches the declaration node with foo and bar, but not
-number.
-(matcher = declStmt(has(decompositionDecl())))
-
-  int number = 42;
-  auto [foo, bar] = std::make_pair{42, 42};
-
- - Matcher<NestedNameSpecifierLoc>nestedNameSpecifierLocMatcher<NestedNameSpecifierLoc>...
Same as nestedNameSpecifier but matches NestedNameSpecifierLoc.
 
@@ -5373,33 +5371,6 @@ and qualType(...) -Matcher<CXXConstructExpr>forEachArgumentWithParamTypeMatcher<Expr> ArgMatcher, Matcher<QualType> ParamMatcher -
Matches all arguments and their respective types for a CallExpr or
-CXXConstructExpr. It is very similar to forEachArgumentWithParam but
-it works on calls through function pointers as well.
-
-The difference is, that function pointers do not provide access to a
-ParmVarDecl, but only the QualType for each argument.
-
-Given
-  void f(int i);
-  int y;
-  f(y);
-  void (*f_ptr)(int) = f;
-  f_ptr(y);
-callExpr(
-  forEachArgumentWithParamType(
-    declRefExpr(to(varDecl(hasName("y")))),
-    qualType(isInteger()).bind("type)
-))
-  matches f(y) and f_ptr(y)
-with declRefExpr(...)
-  matching int y
-and qualType(...)
-  matching int
-
- - Matcher<CXXConstructExpr>hasAnyArgumentMatcher<Expr> InnerMatcher
Matches any argument of a call expression or a constructor call
 expression, or an ObjC-message-send expression.
@@ -5539,16 +5510,7 @@ memberExpr(hasObjectExpression(hasType(pointsTo(
 
 
 Matcher<CXXForRangeStmt>hasBodyMatcher<Stmt> InnerMatcher
-
Matches a 'for', 'while', 'do while' statement or a function
-definition that has a given body.
-
-Given
-  for (;;) {}
-hasBody(compoundStmt())
-  matches 'for (;;) {}'
-with compoundStmt()
-  matching '{}'
-
+

 
 
 Matcher<CXXForRangeStmt>hasInitStatementMatcher<Stmt> InnerMatcher
@@ -5955,33 +5917,6 @@ and qualType(...)
 
-Matcher<CallExpr>forEachArgumentWithParamTypeMatcher<Expr> ArgMatcher, Matcher<QualType> ParamMatcher -
Matches all arguments and their respective types for a CallExpr or
-CXXConstructExpr. It is very similar to forEachArgumentWithParam but
-it works on calls through function pointers as well.
-
-The difference is, that function pointers do not provide access to a
-ParmVarDecl, but only the QualType for each argument.
-
-Given
-  void f(int i);
-  int y;
-  f(y);
-  void (*f_ptr)(int) = f;
-  f_ptr(y);
-callExpr(
-  forEachArgumentWithParamType(
-    declRefExpr(to(varDecl(hasName("y")))),
-    qualType(isInteger()).bind("type)
-))
-  matches f(y) and f_ptr(y)
-with declRefExpr(...)
-  matching int y
-and qualType(...)
-  matching int
-
- - Matcher<CallExpr>hasAnyArgumentMatcher<Expr> InnerMatcher
Matches any argument of a call expression or a constructor call
 expression, or an ObjC-message-send expression.
@@ -6154,7 +6089,7 @@ with compoundStmt()
 
 
 Matcher<DecayedType>hasDecayedTypeMatcher<QualType> InnerType
-
Matches the decayed type, whos decayed type matches InnerMatcher
+
Matches the decayed type, whoes decayed type matches InnerMatcher
 
@@ -6290,16 +6225,7 @@ Usable as: Matcher<DoStmt>hasBodyMatcher<Stmt> InnerMatcher -
Matches a 'for', 'while', 'do while' statement or a function
-definition that has a given body.
-
-Given
-  for (;;) {}
-hasBody(compoundStmt())
-  matches 'for (;;) {}'
-with compoundStmt()
-  matching '{}'
-
+

 
 
 Matcher<DoStmt>hasConditionMatcher<Expr> InnerMatcher
@@ -6566,16 +6492,7 @@ fieldDecl(hasInClassInitializer(anything()))
 
 
 Matcher<ForStmt>hasBodyMatcher<Stmt> InnerMatcher
-
Matches a 'for', 'while', 'do while' statement or a function
-definition that has a given body.
-
-Given
-  for (;;) {}
-hasBody(compoundStmt())
-  matches 'for (;;) {}'
-with compoundStmt()
-  matching '{}'
-
+

 
 
 Matcher<ForStmt>hasConditionMatcher<Expr> InnerMatcher
@@ -6649,6 +6566,24 @@ Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
 
+Matcher<FunctionDecl>hasAnyBodyMatcher<Stmt> InnerMatcher +
Matches a function declaration that has a given body present in the AST.
+Note that this matcher matches all the declarations of a function whose
+body is present in the AST.
+
+Given
+  void f();
+  void f() {}
+  void g();
+hasAnyBody(functionDecl())
+  matches both 'void f();'
+  and 'void f() {}'
+with compoundStmt()
+  matching '{}'
+  but does not match 'void g();'
+
+ + Matcher<FunctionDecl>hasAnyParameterMatcher<ParmVarDecl> InnerMatcher
Matches any parameter of a function or an ObjC method declaration or a
 block.
@@ -6701,16 +6636,7 @@ functionDecl(hasAnyTemplateArgument(refersToType(asString("int"))))
 
 
 Matcher<FunctionDecl>hasBodyMatcher<Stmt> InnerMatcher
-
Matches a 'for', 'while', 'do while' statement or a function
-definition that has a given body.
-
-Given
-  for (;;) {}
-hasBody(compoundStmt())
-  matches 'for (;;) {}'
-with compoundStmt()
-  matching '{}'
-
+

 
 
 Matcher<FunctionDecl>hasExplicitSpecifierMatcher<Expr> InnerMatcher
@@ -7694,7 +7620,7 @@ classTemplateSpecializationDecl(hasAnyTemplateArgument(
 
 
 Matcher<TemplateArgument>refersToIntegralTypeMatcher<QualType> InnerMatcher
-
Matches a TemplateArgument that referes to an integral type.
+
Matches a TemplateArgument that refers to an integral type.
 
 Given
   template<int T> struct C {};
@@ -8068,16 +7994,7 @@ variableArrayType(hasSizeExpr(ignoringImpCasts(declRefExpr(to(
 
 
 Matcher<WhileStmt>hasBodyMatcher<Stmt> InnerMatcher
-
Matches a 'for', 'while', 'do while' statement or a function
-definition that has a given body.
-
-Given
-  for (;;) {}
-hasBody(compoundStmt())
-  matches 'for (;;) {}'
-with compoundStmt()
-  matching '{}'
-
+

 
 
 Matcher<WhileStmt>hasConditionMatcher<Expr> InnerMatcher
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index bd89906..fd79b17 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -1162,7 +1162,7 @@ AST_MATCHER(TemplateArgument, isIntegral) {
   return Node.getKind() == TemplateArgument::Integral;
 }
 
-/// Matches a TemplateArgument that referes to an integral type.
+/// Matches a TemplateArgument that refers to an integral type.
 ///
 /// Given
 /// \code
@@ -6572,7 +6572,7 @@ extern const AstTypeMatcher injectedClassNameType;
 /// \endcode
 extern const AstTypeMatcher decayedType;
 
-/// Matches the decayed type, whos decayed type matches \c InnerMatcher
+/// Matches the decayed type, whoes decayed type matches \c InnerMatcher
 AST_MATCHER_P(DecayedType, hasDecayedType, internal::Matcher,
               InnerType) {
   return InnerType.matches(Node.getDecayedType(), Finder, Builder);