summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-move
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2016-10-14 10:07:58 +0000
committerHaojian Wu <hokein@google.com>2016-10-14 10:07:58 +0000
commit7bd492c53a6cafcefaa968fdc1f18416b58cb17c (patch)
treef6b83d9665ff26cf86bf830d90a3d5a9f89aff23 /clang-tools-extra/clang-move
parent86e72d98dd4e5f7c60cf4e52b885b2980ebc0c5e (diff)
downloadbcm5719-llvm-7bd492c53a6cafcefaa968fdc1f18416b58cb17c.tar.gz
bcm5719-llvm-7bd492c53a6cafcefaa968fdc1f18416b58cb17c.zip
[clang-move] Matching static class member more correctly.
Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25598 llvm-svn: 284221
Diffstat (limited to 'clang-tools-extra/clang-move')
-rw-r--r--clang-tools-extra/clang-move/ClangMove.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-move/ClangMove.cpp b/clang-tools-extra/clang-move/ClangMove.cpp
index a741f559ece..af1711ce5e2 100644
--- a/clang-tools-extra/clang-move/ClangMove.cpp
+++ b/clang-tools-extra/clang-move/ClangMove.cpp
@@ -24,6 +24,11 @@ namespace clang {
namespace move {
namespace {
+// FIXME: Move to ASTMatchers.
+AST_MATCHER(VarDecl, isStaticDataMember) {
+ return Node.isStaticDataMember();
+}
+
AST_MATCHER_P(Decl, hasOutermostEnclosingClass,
ast_matchers::internal::Matcher<Decl>, InnerMatcher) {
const auto* Context = Node.getDeclContext();
@@ -365,7 +370,8 @@ void ClangMoveTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
this);
// Match static member variable definition of the moved class.
- Finder->addMatcher(varDecl(InMovedClass, InOldCC, isDefinition())
+ Finder->addMatcher(varDecl(InMovedClass, InOldCC, isDefinition(),
+ isStaticDataMember())
.bind("class_static_var_decl"),
this);
OpenPOWER on IntegriCloud