diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2015-09-17 13:31:25 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2015-09-17 13:31:25 +0000 |
| commit | b9ea09c4451cb8f33ffd41d22b7dd10e8a68c5c8 (patch) | |
| tree | 362e33db9c2d4fb7ab5fc96172386893a7d50b10 /clang-tools-extra/clang-tidy/google | |
| parent | 512fb64765c7d61e89531b8ff697a85d815d9a13 (diff) | |
| download | bcm5719-llvm-b9ea09c4451cb8f33ffd41d22b7dd10e8a68c5c8.tar.gz bcm5719-llvm-b9ea09c4451cb8f33ffd41d22b7dd10e8a68c5c8.zip | |
Refactors AST matching code to use the new AST matcher names. This patch correlates to r247885 which performs the AST matcher rename in Clang.
llvm-svn: 247886
Diffstat (limited to 'clang-tools-extra/clang-tidy/google')
| -rw-r--r-- | clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp | 4 | ||||
| -rw-r--r-- | clang-tools-extra/clang-tidy/google/OverloadedUnaryAndCheck.cpp | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp index 22e2139fbd4..68baf708007 100644 --- a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp @@ -23,8 +23,8 @@ void ExplicitConstructorCheck::registerMatchers(MatchFinder *Finder) { // Only register the matchers for C++; the functionality currently does not // provide any benefit to other languages, despite being benign. if (getLangOpts().CPlusPlus) - Finder->addMatcher(constructorDecl(unless(isInstantiated())).bind("ctor"), - this); + Finder->addMatcher( + cxxConstructorDecl(unless(isInstantiated())).bind("ctor"), this); } // Looks for the token matching the predicate and returns the range of the found diff --git a/clang-tools-extra/clang-tidy/google/OverloadedUnaryAndCheck.cpp b/clang-tools-extra/clang-tidy/google/OverloadedUnaryAndCheck.cpp index 5dad36f60e0..6fb1ca9d662 100644 --- a/clang-tools-extra/clang-tidy/google/OverloadedUnaryAndCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/OverloadedUnaryAndCheck.cpp @@ -27,14 +27,15 @@ OverloadedUnaryAndCheck::registerMatchers(ast_matchers::MatchFinder *Finder) { return; // Match unary methods that overload operator&. - Finder->addMatcher(methodDecl(parameterCountIs(0), hasOverloadedOperatorName( - "&")).bind("overload"), - this); + Finder->addMatcher( + cxxMethodDecl(parameterCountIs(0), hasOverloadedOperatorName("&")) + .bind("overload"), + this); // Also match freestanding unary operator& overloads. Be careful not to match // binary methods. Finder->addMatcher( functionDecl( - allOf(unless(methodDecl()), + allOf(unless(cxxMethodDecl()), functionDecl(parameterCountIs(1), hasOverloadedOperatorName("&")).bind("overload"))), this); |

