[PATCH] Add support for the hasDeclaration() matcher in the dynamic layer.
Samuel Benzaquen
sbenza at google.com
Fri Nov 15 09:43:31 PST 2013
================
Comment at: docs/LibASTMatchersReference.html:2509
@@ -2497,3 +2508,3 @@
function. e.g. various subtypes of clang::Type and various expressions.
FIXME: Add all node types for which this is matcher is usable due to
getDecl().
----------------
Manuel Klimek wrote:
> Perhaps fix the fixme? :)
Done.
================
Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:666
@@ +665,3 @@
+/// \brief All types that are supported by HasDeclarationMatcher above.
+typedef internal::TypeList<
+ internal::TypeList<CallExpr, CXXConstructExpr, DeclRefExpr, EnumType>,
----------------
Manuel Klimek wrote:
> Any reason we can't inline this into the method decl (and ideally parse it for the doc-generator from there). Doesn't seem worse than the "usable as" comment (and easier to keep in sync)
Mainly because I didn't want to add the macros all the way to _14().
Also, it is a pain having to write it twice (one in the function signature, and another in the return statement).
http://llvm-reviews.chandlerc.com/D1889
BRANCH
has_decl
ARCANIST PROJECT
clang
More information about the cfe-commits
mailing list