[clang-tools-extra] r282477 - [clang-move] Use isStaticStorageClass matcher.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 01:01:05 PDT 2016


Author: hokein
Date: Tue Sep 27 03:01:04 2016
New Revision: 282477

URL: http://llvm.org/viewvc/llvm-project?rev=282477&view=rev
Log:
[clang-move] Use isStaticStorageClass matcher.

Modified:
    clang-tools-extra/trunk/clang-move/ClangMove.cpp

Modified: clang-tools-extra/trunk/clang-move/ClangMove.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-move/ClangMove.cpp?rev=282477&r1=282476&r2=282477&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-move/ClangMove.cpp (original)
+++ clang-tools-extra/trunk/clang-move/ClangMove.cpp Tue Sep 27 03:01:04 2016
@@ -23,12 +23,6 @@ namespace clang {
 namespace move {
 namespace {
 
-// FIXME: Move to ASTMatcher.
-AST_POLYMORPHIC_MATCHER(isStatic, AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl,
-                                                                  VarDecl)) {
-  return Node.getStorageClass() == SC_Static;
-}
-
 class FindAllIncludes : public clang::PPCallbacks {
 public:
   explicit FindAllIncludes(SourceManager *SM, ClangMoveTool *const MoveTool)
@@ -241,9 +235,9 @@ void ClangMoveTool::registerMatchers(ast
   // Match static functions/variabale definitions in old cc.
   Finder->addMatcher(
       namedDecl(anyOf(functionDecl(isDefinition(), unless(InMovedClass),
-                                   isStatic(), InOldCC),
-                      varDecl(isDefinition(), unless(InMovedClass), isStatic(),
-                              InOldCC)))
+                                   isStaticStorageClass(), InOldCC),
+                      varDecl(isDefinition(), unless(InMovedClass),
+                              isStaticStorageClass(), InOldCC)))
           .bind("static_decls"),
       this);
 




More information about the cfe-commits mailing list