[clang-tidy] anyOf(hasName(..), hasName(..)) -> hasAnyName
authorAlexander Kornienko <alexfh@google.com>
Fri, 22 Mar 2019 18:37:45 +0000 (18:37 +0000)
committerAlexander Kornienko <alexfh@google.com>
Fri, 22 Mar 2019 18:37:45 +0000 (18:37 +0000)
+ a minor style fix

llvm-svn: 356792

clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.h

index 6b418d4..fb8c583 100644 (file)
@@ -19,10 +19,10 @@ namespace clang {
 namespace tidy {
 namespace cert {
 
-const char SetLongJmpCheck::DiagWording[] =
+namespace {
+const char DiagWording[] =
     "do not call %0; consider using exception handling instead";
 
-namespace {
 class SetJmpMacroCallbacks : public PPCallbacks {
   SetLongJmpCheck &Check;
 
@@ -36,7 +36,7 @@ public:
       return;
 
     if (II->getName() == "setjmp")
-      Check.diag(Range.getBegin(), Check.DiagWording) << II;
+      Check.diag(Range.getBegin(), DiagWording) << II;
   }
 };
 } // namespace
@@ -62,10 +62,10 @@ void SetLongJmpCheck::registerMatchers(MatchFinder *Finder) {
   // In case there is an implementation that happens to define setjmp as a
   // function instead of a macro, this will also catch use of it. However, we
   // are primarily searching for uses of longjmp.
-  Finder->addMatcher(callExpr(callee(functionDecl(anyOf(hasName("setjmp"),
-                                                        hasName("longjmp")))))
-                         .bind("expr"),
-                     this);
+  Finder->addMatcher(
+      callExpr(callee(functionDecl(hasAnyName("setjmp", "longjmp"))))
+          .bind("expr"),
+      this);
 }
 
 void SetLongJmpCheck::check(const MatchFinder::MatchResult &Result) {
index ea20ba7..660545d 100644 (file)
@@ -26,8 +26,6 @@ public:
   void registerMatchers(ast_matchers::MatchFinder *Finder) override;
   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
   void registerPPCallbacks(CompilerInstance &Compiler) override;
-
-  static const char DiagWording[];
 };
 
 } // namespace cert