<div dir="ltr">Please tell me that you have a clang-tidy check that fixed this for you :)</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 27, 2014 at 8:14 AM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: alexfh<br>
Date: Thu Feb 27 07:14:51 2014<br>
New Revision: 202392<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=202392&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=202392&view=rev</a><br>
Log:<br>
Normalized "virtual" and "LLVM_OVERRIDE" usage in clang-tidy.<br>
<br>
Reviewers: klimek<br>
<br>
Reviewed By: klimek<br>
<br>
CC: cfe-commits<br>
<br>
Differential Revision: <a href="http://llvm-reviews.chandlerc.com/D2894" target="_blank">http://llvm-reviews.chandlerc.com/D2894</a><br>
<br>
Modified:<br>
    clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp<br>
    clang-tools-extra/trunk/clang-tidy/ClangTidy.h<br>
    clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h<br>
    clang-tools-extra/trunk/clang-tidy/ClangTidyModule.h<br>
    clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.cpp<br>
    clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.h<br>
    clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp<br>
    clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.h<br>
<br>
Modified: clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp?rev=202392&r1=202391&r2=202392&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp?rev=202392&r1=202391&r2=202392&view=diff</a><br>

==============================================================================<br>
--- clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp Thu Feb 27 07:14:51 2014<br>
@@ -64,9 +64,8 @@ class AnalyzerDiagnosticConsumer : publi<br>
 public:<br>
   AnalyzerDiagnosticConsumer(ClangTidyContext &Context) : Context(Context) {}<br>
<br>
-  virtual void<br>
-  FlushDiagnosticsImpl(std::vector<const ento::PathDiagnostic *> &Diags,<br>
-                       FilesMade *filesMade) LLVM_OVERRIDE {<br>
+  void FlushDiagnosticsImpl(std::vector<const ento::PathDiagnostic *> &Diags,<br>
+                            FilesMade *filesMade) LLVM_OVERRIDE {<br>
     for (std::vector<const ento::PathDiagnostic *>::iterator I = Diags.begin(),<br>
                                                              E = Diags.end();<br>
          I != E; ++I) {<br>
@@ -89,14 +88,9 @@ public:<br>
     }<br>
   }<br>
<br>
-  virtual StringRef getName() const { return "ClangTidyDiags"; }<br>
-<br>
-  virtual bool supportsLogicalOpControlFlow() const LLVM_OVERRIDE {<br>
-    return true;<br>
-  }<br>
-  virtual bool supportsCrossFileDiagnostics() const LLVM_OVERRIDE {<br>
-    return true;<br>
-  }<br>
+  StringRef getName() const LLVM_OVERRIDE { return "ClangTidyDiags"; }<br>
+  bool supportsLogicalOpControlFlow() const LLVM_OVERRIDE { return true; }<br>
+  bool supportsCrossFileDiagnostics() const LLVM_OVERRIDE { return true; }<br>
<br>
 private:<br>
   ClangTidyContext &Context;<br>
<br>
Modified: clang-tools-extra/trunk/clang-tidy/ClangTidy.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidy.h?rev=202392&r1=202391&r2=202392&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidy.h?rev=202392&r1=202391&r2=202392&view=diff</a><br>

==============================================================================<br>
--- clang-tools-extra/trunk/clang-tidy/ClangTidy.h (original)<br>
+++ clang-tools-extra/trunk/clang-tidy/ClangTidy.h Thu Feb 27 07:14:51 2014<br>
@@ -83,7 +83,7 @@ public:<br>
   void setName(StringRef Name);<br>
<br>
 private:<br>
-  virtual void run(const ast_matchers::MatchFinder::MatchResult &Result);<br>
+  void run(const ast_matchers::MatchFinder::MatchResult &Result) LLVM_OVERRIDE;<br>
   ClangTidyContext *Context;<br>
   std::string CheckName;<br>
 };<br>
<br>
Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h?rev=202392&r1=202391&r2=202392&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h?rev=202392&r1=202391&r2=202392&view=diff</a><br>

==============================================================================<br>
--- clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h (original)<br>
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h Thu Feb 27 07:14:51 2014<br>
@@ -116,11 +116,11 @@ public:<br>
   // FIXME: The concept of converting between FixItHints and Replacements is<br>
   // more generic and should be pulled out into a more useful Diagnostics<br>
   // library.<br>
-  virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,<br>
-                                const Diagnostic &Info) LLVM_OVERRIDE;<br>
+  void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,<br>
+                        const Diagnostic &Info) LLVM_OVERRIDE;<br>
<br>
   // Flushes the internal diagnostics buffer to the ClangTidyContext.<br>
-  virtual void finish() LLVM_OVERRIDE;<br>
+  void finish() LLVM_OVERRIDE;<br>
<br>
 private:<br>
   void addFixes(const Diagnostic &Info, ClangTidyError &Error);<br>
<br>
Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyModule.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyModule.h?rev=202392&r1=202391&r2=202392&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyModule.h?rev=202392&r1=202391&r2=202392&view=diff</a><br>

==============================================================================<br>
--- clang-tools-extra/trunk/clang-tidy/ClangTidyModule.h (original)<br>
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyModule.h Thu Feb 27 07:14:51 2014<br>
@@ -36,13 +36,16 @@ public:<br>
 /// For example, if have a clang-tidy check like:<br>
 /// \code<br>
 /// class MyTidyCheck : public ClangTidyCheck {<br>
-///   virtual void registerMatchers(ast_matchers::MatchFinder *Finder) { .. }<br>
+///   void registerMatchers(ast_matchers::MatchFinder *Finder) LLVM_OVERRIDE {<br>
+///     ..<br>
+///   }<br>
 /// };<br>
 /// \endcode<br>
 /// you can register it with:<br>
 /// \code<br>
 /// class MyModule : public ClangTidyModule {<br>
-///   virtual void addCheckFactories(ClangTidyCheckFactories &CheckFactories) {<br>
+///   void<br>
+///   addCheckFactories(ClangTidyCheckFactories &CheckFactories) LLVM_OVERRIDE {<br>
 ///     CheckFactories.addCheckFactory(<br>
 ///         "myproject-my-check", new ClangTidyCheckFactory<MyTidyCheck>());<br>
 ///   }<br>
@@ -50,7 +53,7 @@ public:<br>
 /// \endcode<br>
 template <typename T> class ClangTidyCheckFactory : public CheckFactoryBase {<br>
 public:<br>
-  virtual ClangTidyCheck *createCheck() { return new T; }<br>
+  ClangTidyCheck *createCheck() LLVM_OVERRIDE { return new T; }<br>
 };<br>
<br>
 class ClangTidyCheckFactories;<br>
<br>
Modified: clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.cpp?rev=202392&r1=202391&r2=202392&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.cpp?rev=202392&r1=202391&r2=202392&view=diff</a><br>

==============================================================================<br>
--- clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.cpp Thu Feb 27 07:14:51 2014<br>
@@ -44,7 +44,8 @@ void ExplicitConstructorCheck::check(con<br>
<br>
 class GoogleModule : public ClangTidyModule {<br>
 public:<br>
-  virtual void addCheckFactories(ClangTidyCheckFactories &CheckFactories) {<br>
+  void<br>
+  addCheckFactories(ClangTidyCheckFactories &CheckFactories) LLVM_OVERRIDE {<br>
     CheckFactories.addCheckFactory(<br>
         "google-explicit-constructor",<br>
         new ClangTidyCheckFactory<ExplicitConstructorCheck>());<br>
<br>
Modified: clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.h?rev=202392&r1=202391&r2=202392&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.h?rev=202392&r1=202391&r2=202392&view=diff</a><br>

==============================================================================<br>
--- clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.h (original)<br>
+++ clang-tools-extra/trunk/clang-tidy/google/GoogleTidyModule.h Thu Feb 27 07:14:51 2014<br>
@@ -21,8 +21,9 @@ namespace tidy {<br>
 /// <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Explicit_Constructors" target="_blank">http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Explicit_Constructors</a><br>
 class ExplicitConstructorCheck : public ClangTidyCheck {<br>
 public:<br>
-  virtual void registerMatchers(ast_matchers::MatchFinder *Finder);<br>
-  virtual void check(const ast_matchers::MatchFinder::MatchResult &Result);<br>
+  void registerMatchers(ast_matchers::MatchFinder *Finder) LLVM_OVERRIDE;<br>
+  void<br>
+  check(const ast_matchers::MatchFinder::MatchResult &Result) LLVM_OVERRIDE;<br>
 };<br>
<br>
 } // namespace tidy<br>
<br>
Modified: clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp?rev=202392&r1=202391&r2=202392&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp?rev=202392&r1=202391&r2=202392&view=diff</a><br>

==============================================================================<br>
--- clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.cpp Thu Feb 27 07:14:51 2014<br>
@@ -24,8 +24,7 @@ using namespace clang::ast_matchers;<br>
 namespace clang {<br>
 namespace tidy {<br>
<br>
-void<br>
-NamespaceCommentCheck::registerMatchers(ast_matchers::MatchFinder *Finder) {<br>
+void NamespaceCommentCheck::registerMatchers(MatchFinder *Finder) {<br>
   Finder->addMatcher(namespaceDecl().bind("namespace"), this);<br>
 }<br>
<br>
@@ -55,15 +54,13 @@ void NamespaceCommentCheck::check(const<br>
 namespace {<br>
 class IncludeOrderPPCallbacks : public PPCallbacks {<br>
 public:<br>
-  explicit IncludeOrderPPCallbacks(IncludeOrderCheck &Check)<br>
-      : Check(Check) {}<br>
+  explicit IncludeOrderPPCallbacks(IncludeOrderCheck &Check) : Check(Check) {}<br>
<br>
-  virtual void InclusionDirective(SourceLocation HashLoc,<br>
-                                  const Token &IncludeTok, StringRef FileName,<br>
-                                  bool IsAngled, CharSourceRange FilenameRange,<br>
-                                  const FileEntry *File, StringRef SearchPath,<br>
-                                  StringRef RelativePath,<br>
-                                  const Module *Imported) {<br>
+  void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,<br>
+                          StringRef FileName, bool IsAngled,<br>
+                          CharSourceRange FilenameRange, const FileEntry *File,<br>
+                          StringRef SearchPath, StringRef RelativePath,<br>
+                          const Module *Imported) LLVM_OVERRIDE {<br>
     // FIXME: This is a dummy implementation to show how to get at preprocessor<br>
     // information. Implement a real include order check.<br>
     Check.diag(HashLoc, "This is an include");<br>
@@ -81,9 +78,8 @@ void IncludeOrderCheck::registerPPCallba<br>
<br>
 class LLVMModule : public ClangTidyModule {<br>
 public:<br>
-  virtual ~LLVMModule() {}<br>
-<br>
-  virtual void addCheckFactories(ClangTidyCheckFactories &CheckFactories) {<br>
+  void<br>
+  addCheckFactories(ClangTidyCheckFactories &CheckFactories) LLVM_OVERRIDE {<br>
     CheckFactories.addCheckFactory(<br>
         "llvm-include-order", new ClangTidyCheckFactory<IncludeOrderCheck>());<br>
     CheckFactories.addCheckFactory(<br>
<br>
Modified: clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.h?rev=202392&r1=202391&r2=202392&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.h?rev=202392&r1=202391&r2=202392&view=diff</a><br>

==============================================================================<br>
--- clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.h (original)<br>
+++ clang-tools-extra/trunk/clang-tidy/llvm/LLVMTidyModule.h Thu Feb 27 07:14:51 2014<br>
@@ -20,7 +20,7 @@ namespace tidy {<br>
 /// see: <a href="http://llvm.org/docs/CodingStandards.html#include-style" target="_blank">http://llvm.org/docs/CodingStandards.html#include-style</a><br>
 class IncludeOrderCheck : public ClangTidyCheck {<br>
 public:<br>
-  virtual void registerPPCallbacks(CompilerInstance &Compiler);<br>
+  void registerPPCallbacks(CompilerInstance &Compiler) LLVM_OVERRIDE;<br>
 };<br>
<br>
 /// \brief Checks that long namespaces have a closing comment.<br>
@@ -28,8 +28,9 @@ public:<br>
 /// see: <a href="http://llvm.org/docs/CodingStandards.html#namespace-indentation" target="_blank">http://llvm.org/docs/CodingStandards.html#namespace-indentation</a><br>
 class NamespaceCommentCheck : public ClangTidyCheck {<br>
 public:<br>
-  virtual void registerMatchers(ast_matchers::MatchFinder *Finder);<br>
-  virtual void check(const ast_matchers::MatchFinder::MatchResult &Result);<br>
+  void registerMatchers(ast_matchers::MatchFinder *Finder) LLVM_OVERRIDE;<br>
+  void<br>
+  check(const ast_matchers::MatchFinder::MatchResult &Result) LLVM_OVERRIDE;<br>
 };<br>
<br>
 } // namespace tidy<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>