[clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follo...
authorAlexander Kornienko <alexfh@google.com>
Mon, 9 Mar 2015 12:18:39 +0000 (12:18 +0000)
committerAlexander Kornienko <alexfh@google.com>
Mon, 9 Mar 2015 12:18:39 +0000 (12:18 +0000)
Classes are named WhateverCheck, files are WhateverCheck.cpp and`
WhateverCheck.h`

http://reviews.llvm.org/D8144

Patch by Richard Thomson!

llvm-svn: 231650

clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
clang-tools-extra/clang-tidy/readability/CMakeLists.txt
clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp [moved from clang-tools-extra/clang-tidy/readability/ContainerSizeEmpty.cpp with 98% similarity]
clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.h [moved from clang-tools-extra/clang-tidy/readability/ContainerSizeEmpty.h with 92% similarity]
clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp [moved from clang-tools-extra/clang-tidy/readability/FunctionSize.cpp with 99% similarity]
clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.h [moved from clang-tools-extra/clang-tidy/readability/FunctionSize.h with 93% similarity]
clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp [moved from clang-tools-extra/clang-tidy/readability/RedundantSmartptrGet.cpp with 94% similarity]
clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.h [moved from clang-tools-extra/clang-tidy/readability/RedundantSmartptrGet.h with 80% similarity]

index c7a5c10..6757f75 100644 (file)
@@ -11,9 +11,9 @@
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
 #include "../readability/BracesAroundStatementsCheck.h"
-#include "../readability/FunctionSize.h"
+#include "../readability/FunctionSizeCheck.h"
 #include "../readability/NamespaceCommentCheck.h"
-#include "../readability/RedundantSmartptrGet.h"
+#include "../readability/RedundantSmartptrGetCheck.h"
 #include "AvoidCStyleCastsCheck.h"
 #include "ExplicitConstructorCheck.h"
 #include "ExplicitMakePairCheck.h"
@@ -69,7 +69,7 @@ public:
         .registerCheck<clang::tidy::readability::NamespaceCommentCheck>(
             "google-readability-namespace-comments");
     CheckFactories
-        .registerCheck<clang::tidy::readability::RedundantSmartptrGet>(
+        .registerCheck<clang::tidy::readability::RedundantSmartptrGetCheck>(
             "google-readability-redundant-smartptr-get");
   }
 
index 567ac1d..ca6456f 100644 (file)
@@ -2,12 +2,12 @@ set(LLVM_LINK_COMPONENTS support)
 
 add_clang_library(clangTidyReadabilityModule
   BracesAroundStatementsCheck.cpp
-  ContainerSizeEmpty.cpp
+  ContainerSizeEmptyCheck.cpp
   ElseAfterReturnCheck.cpp
-  FunctionSize.cpp
+  FunctionSizeCheck.cpp
   NamespaceCommentCheck.cpp
   ReadabilityTidyModule.cpp
-  RedundantSmartptrGet.cpp
+  RedundantSmartptrGetCheck.cpp
   ShrinkToFitCheck.cpp
 
   LINK_LIBS
@@ -1,4 +1,4 @@
-//===--- ContainerSizeEmpty.cpp - clang-tidy ------------------------------===//
+//===--- ContainerSizeEmptyCheck.cpp - clang-tidy -------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -6,7 +6,7 @@
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
-#include "ContainerSizeEmpty.h"
+#include "ContainerSizeEmptyCheck.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/ASTMatchers/ASTMatchers.h"
 #include "clang/Lex/Lexer.h"
@@ -1,4 +1,4 @@
-//===--- ContainerSizeEmpty.h - clang-tidy ----------------------*- C++ -*-===//
+//===--- ContainerSizeEmptyCheck.h - clang-tidy -----------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTY_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTY_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTYCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTYCHECK_H
 
 #include "../ClangTidy.h"
 
@@ -37,4 +37,4 @@ public:
 } // namespace tidy
 } // namespace clang
 
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTY_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTYCHECK_H
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "FunctionSize.h"
+#include "FunctionSizeCheck.h"
 #include "clang/ASTMatchers/ASTMatchFinder.h"
 
 using namespace clang::ast_matchers;
@@ -1,4 +1,4 @@
-//===--- FunctionSize.h - clang-tidy ----------------------------*- C++ -*-===//
+//===--- FunctionSizeCheck.h - clang-tidy -----------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZE_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZE_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H
 
 #include "../ClangTidy.h"
 
@@ -45,4 +45,4 @@ private:
 } // namespace tidy
 } // namespace clang
 
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZE_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H
index a92f8a4..e868303 100644 (file)
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
 #include "BracesAroundStatementsCheck.h"
-#include "ContainerSizeEmpty.h"
+#include "ContainerSizeEmptyCheck.h"
 #include "ElseAfterReturnCheck.h"
-#include "FunctionSize.h"
-#include "RedundantSmartptrGet.h"
+#include "FunctionSizeCheck.h"
+#include "RedundantSmartptrGetCheck.h"
 #include "ShrinkToFitCheck.h"
 
 namespace clang {
@@ -32,7 +32,7 @@ public:
         "readability-else-after-return");
     CheckFactories.registerCheck<FunctionSizeCheck>(
         "readability-function-size");
-    CheckFactories.registerCheck<RedundantSmartptrGet>(
+    CheckFactories.registerCheck<RedundantSmartptrGetCheck>(
         "readability-redundant-smartptr-get");
     CheckFactories.registerCheck<ShrinkToFitCheck>(
         "readability-shrink-to-fit");
@@ -1,4 +1,4 @@
-//===--- RedundantSmartptrGet.cpp - clang-tidy ----------------------------===//
+//===--- RedundantSmartptrGetCheck.cpp - clang-tidy -----------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "RedundantSmartptrGet.h"
+#include "RedundantSmartptrGetCheck.h"
 #include "clang/ASTMatchers/ASTMatchFinder.h"
 #include "clang/Lex/Lexer.h"
 
@@ -73,7 +73,7 @@ void registerMatchersForGetEquals(MatchFinder *Finder,
 
 }  // namespace
 
-void RedundantSmartptrGet::registerMatchers(MatchFinder *Finder) {
+void RedundantSmartptrGetCheck::registerMatchers(MatchFinder *Finder) {
   registerMatchersForGetArrowStart(Finder, this);
   registerMatchersForGetEquals(Finder, this);
 }
@@ -96,7 +96,7 @@ bool allReturnTypesMatch(const MatchFinder::MatchResult &Result) {
 }
 }  // namespace
 
-void RedundantSmartptrGet::check(const MatchFinder::MatchResult &Result) {
+void RedundantSmartptrGetCheck::check(const MatchFinder::MatchResult &Result) {
   if (!allReturnTypesMatch(Result)) return;
 
   bool IsPtrToPtr = Result.Nodes.getNodeAs<Decl>("ptr_to_ptr") != nullptr;
@@ -1,4 +1,4 @@
-//===--- RedundantSmartptrGet.h - clang-tidy --------------------*- C++ -*-===//
+//===--- RedundantSmartptrGetCheck.h - clang-tidy ---------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGET_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGET_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGETCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGETCHECK_H
 
 #include "../ClangTidy.h"
 
@@ -22,9 +22,9 @@ namespace readability {
 ///   ptr.get()->Foo()  ==>  ptr->Foo()
 ///   *ptr.get()  ==>  *ptr
 ///   *ptr->get()  ==>  **ptr
-class RedundantSmartptrGet : public ClangTidyCheck {
+class RedundantSmartptrGetCheck : public ClangTidyCheck {
 public:
-  RedundantSmartptrGet(StringRef Name, ClangTidyContext *Context)
+  RedundantSmartptrGetCheck(StringRef Name, ClangTidyContext *Context)
       : ClangTidyCheck(Name, Context) {}
   void registerMatchers(ast_matchers::MatchFinder *Finder) override;
   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
@@ -34,5 +34,4 @@ public:
 } // namespace tidy
 } // namespace clang
 
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGET_H
-
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGETCHECK_H