]> granicus.if.org Git - clang/commitdiff
Updating the documentation for the hasAttr AST matcher, which behaves somewhat differ...
authorAaron Ballman <aaron@aaronballman.com>
Thu, 23 Jul 2015 17:54:59 +0000 (17:54 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Thu, 23 Jul 2015 17:54:59 +0000 (17:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243029 91177308-0d34-0410-b5e6-96231b3b80d8

docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h

index f4471364f24b9bb7088a1209e29885201e0fded2..5e34d65f2ff9b73bd463c00f77d9f94d1304f583 100644 (file)
@@ -1692,7 +1692,8 @@ and reference to that variable declaration within a compound statement.
 Given
   __attribute__((device)) void f() { ... }
 decl(hasAttr(clang::attr::CUDADevice)) matches the function declaration of
-f.
+f. If the matcher is use from clang-query, attr::Kind parameter should be
+passed as a quoted string. e.g., hasAttr("attr::CUDADevice").
 </pre></td></tr>
 
 
index 4e7625c1c250422a0bbba07cb20e90e327edb660..88f9f07885237d1c92f090716d8854d121fbae55 100644 (file)
@@ -4109,7 +4109,8 @@ AST_MATCHER_P(CaseStmt, hasCaseConstant, internal::Matcher<Expr>,
 ///   __attribute__((device)) void f() { ... }
 /// \endcode
 /// decl(hasAttr(clang::attr::CUDADevice)) matches the function declaration of
-/// f.
+/// f. If the matcher is use from clang-query, attr::Kind parameter should be
+/// passed as a quoted string. e.g., hasAttr("attr::CUDADevice").
 AST_MATCHER_P(Decl, hasAttr, attr::Kind, AttrKind) {
   for (const auto *Attr : Node.attrs()) {
     if (Attr->getKind() == AttrKind)