astrelni updated this revision to Diff 204312.
astrelni added a comment.

Style updates.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62977/new/

https://reviews.llvm.org/D62977

Files:
  clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
  clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.h

Index: clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.h
===================================================================
--- clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.h
+++ clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.h
@@ -10,7 +10,6 @@
 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_UPGRADEGOOGLETESTCASECHECK_H
 
 #include "../ClangTidyCheck.h"
-
 #include <unordered_set>
 
 namespace clang {
Index: clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
+++ clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
@@ -15,13 +15,13 @@
 namespace clang {
 namespace tidy {
 namespace google {
-namespace {
 
-const llvm::StringRef CheckMessage =
+static const llvm::StringRef CheckMessage =
     "Googletest APIs named with 'case' are deprecated; use equivalent APIs "
     "named with 'suite'";
 
-llvm::Optional<llvm::StringRef> getNewMacroName(llvm::StringRef MacroName) {
+static llvm::Optional<llvm::StringRef>
+getNewMacroName(llvm::StringRef MacroName) {
   std::pair<llvm::StringRef, llvm::StringRef> ReplacementMap[] = {
       {"TYPED_TEST_CASE", "TYPED_TEST_SUITE"},
       {"TYPED_TEST_CASE_P", "TYPED_TEST_SUITE_P"},
@@ -38,6 +38,8 @@
   return llvm::None;
 }
 
+namespace {
+
 class UpgradeGoogletestCasePPCallback : public PPCallbacks {
 public:
   UpgradeGoogletestCasePPCallback(UpgradeGoogletestCaseCheck *Check,
@@ -81,7 +83,7 @@
     if (!Replacement)
       return;
 
-    StringRef FileName = PP->getSourceManager().getFilename(
+    llvm::StringRef FileName = PP->getSourceManager().getFilename(
         MD.getMacroInfo()->getDefinitionLoc());
     if (!FileName.endswith("gtest/gtest-typed-test.h"))
       return;
@@ -165,9 +167,7 @@
       this);
 }
 
-namespace {
-
-llvm::StringRef getNewMethodName(llvm::StringRef CurrentName) {
+static llvm::StringRef getNewMethodName(llvm::StringRef CurrentName) {
   std::pair<llvm::StringRef, llvm::StringRef> ReplacementMap[] = {
       {"SetUpTestCase", "SetUpTestSuite"},
       {"TearDownTestCase", "TearDownTestSuite"},
@@ -190,21 +190,22 @@
 }
 
 template <typename NodeType>
-bool isInInstantiation(const NodeType &Node,
-                       const MatchFinder::MatchResult &Result) {
+static bool isInInstantiation(const NodeType &Node,
+                              const MatchFinder::MatchResult &Result) {
   return !match(isInTemplateInstantiation(), Node, *Result.Context).empty();
 }
 
 template <typename NodeType>
-bool isInTemplate(const NodeType &Node,
-                  const MatchFinder::MatchResult &Result) {
+static bool isInTemplate(const NodeType &Node,
+                         const MatchFinder::MatchResult &Result) {
   internal::Matcher<NodeType> IsInsideTemplate =
       hasAncestor(decl(anyOf(classTemplateDecl(), functionTemplateDecl())));
   return !match(IsInsideTemplate, Node, *Result.Context).empty();
 }
 
-bool derivedTypeHasReplacementMethod(const MatchFinder::MatchResult &Result,
-                                     llvm::StringRef ReplacementMethod) {
+static bool
+derivedTypeHasReplacementMethod(const MatchFinder::MatchResult &Result,
+                                llvm::StringRef ReplacementMethod) {
   const auto *Class = Result.Nodes.getNodeAs<CXXRecordDecl>("class");
   return !match(cxxRecordDecl(
                     unless(isExpansionInFileMatching(
@@ -214,7 +215,8 @@
               .empty();
 }
 
-CharSourceRange getAliasNameRange(const MatchFinder::MatchResult &Result) {
+static CharSourceRange
+getAliasNameRange(const MatchFinder::MatchResult &Result) {
   if (const auto *Using = Result.Nodes.getNodeAs<UsingDecl>("using")) {
     return CharSourceRange::getTokenRange(
         Using->getNameInfo().getSourceRange());
@@ -223,8 +225,6 @@
       Result.Nodes.getNodeAs<TypeLoc>("typeloc")->getSourceRange());
 }
 
-} // namespace
-
 void UpgradeGoogletestCaseCheck::check(const MatchFinder::MatchResult &Result) {
   llvm::StringRef ReplacementText;
   CharSourceRange ReplacementRange;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to