[clang-tools-extra] r245340 - We no longer need a custom matcher for this; use the builtin AST matcher instead. NFC, and existing tests should cover this change.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 18 13:27:44 PDT 2015


Author: aaronballman
Date: Tue Aug 18 15:27:44 2015
New Revision: 245340

URL: http://llvm.org/viewvc/llvm-project?rev=245340&view=rev
Log:
We no longer need a custom matcher for this; use the builtin AST matcher instead. NFC, and existing tests should cover this change.

Modified:
    clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp?rev=245340&r1=245339&r2=245340&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp Tue Aug 18 15:27:44 2015
@@ -15,20 +15,14 @@
 using namespace clang::ast_matchers;
 
 namespace clang {
-namespace {
-AST_MATCHER(NamespaceDecl, isAnonymousNamespace) {
-  return Node.isAnonymousNamespace();
-}
-} // namespace
-
 namespace tidy {
 namespace google {
 namespace build {
 
 void UnnamedNamespaceInHeaderCheck::registerMatchers(
     ast_matchers::MatchFinder *Finder) {
-  Finder->addMatcher(
-      namespaceDecl(isAnonymousNamespace()).bind("anonymousNamespace"), this);
+  Finder->addMatcher(namespaceDecl(isAnonymous()).bind("anonymousNamespace"),
+                     this);
 }
 
 void




More information about the cfe-commits mailing list