summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2014-11-24 09:10:56 +0000
committerManuel Klimek <klimek@google.com>2014-11-24 09:10:56 +0000
commitda50ff8e4a63a1bb0f80b1c1f3d71db84485fd77 (patch)
tree924b4cdf295e77f1a64cbf13d7226ca058ff444b /clang/lib/ASTMatchers
parentb2a6e7458d7229d53e59824d0a350b1a054f165a (diff)
downloadbcm5719-llvm-da50ff8e4a63a1bb0f80b1c1f3d71db84485fd77.tar.gz
bcm5719-llvm-da50ff8e4a63a1bb0f80b1c1f3d71db84485fd77.zip
Adding 4 ASTMatchers: typedefDecl, isInMainFile, isInSystemFile, isInFileMatchingName
Summary: Often one is only interested in matches within the main-file or matches that are not within a system-header, for which this patch adds isInMainFile and isInSystemFile. They take no arguments and narrow down the matches. The isInFileMatchingName is mainly thought for interactive clang-query-sessions, to make a matcher more specific without restarting the session with the files you are interested in for that moment. It takes a string that will be used as regular-expression to match the filename of where the matched node is expanded. Patch by Hendrik von Prince. llvm-svn: 222646
Diffstat (limited to 'clang/lib/ASTMatchers')
-rw-r--r--clang/lib/ASTMatchers/Dynamic/Registry.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/ASTMatchers/Dynamic/Registry.cpp b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
index dab41871714..c0816ace44e 100644
--- a/clang/lib/ASTMatchers/Dynamic/Registry.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
@@ -242,7 +242,10 @@ RegistryMaps::RegistryMaps() {
REGISTER_MATCHER(isExpr);
REGISTER_MATCHER(isExternC);
REGISTER_MATCHER(isImplicit);
+ REGISTER_MATCHER(isExpansionInFileMatching);
+ REGISTER_MATCHER(isExpansionInMainFile);
REGISTER_MATCHER(isInstantiated);
+ REGISTER_MATCHER(isExpansionInSystemHeader);
REGISTER_MATCHER(isInteger);
REGISTER_MATCHER(isIntegral);
REGISTER_MATCHER(isInTemplateInstantiation);
@@ -314,6 +317,7 @@ RegistryMaps::RegistryMaps() {
REGISTER_MATCHER(to);
REGISTER_MATCHER(tryStmt);
REGISTER_MATCHER(type);
+ REGISTER_MATCHER(typedefDecl);
REGISTER_MATCHER(typedefType);
REGISTER_MATCHER(typeLoc);
REGISTER_MATCHER(unaryExprOrTypeTraitExpr);
OpenPOWER on IntegriCloud