[clang-tools-extra] r234681 - Use 'override/final' instead of 'virtual' for overridden methods

Alexander Kornienko alexfh at google.com
Sat Apr 11 00:59:34 PDT 2015


Author: alexfh
Date: Sat Apr 11 02:59:33 2015
New Revision: 234681

URL: http://llvm.org/viewvc/llvm-project?rev=234681&view=rev
Log:
Use 'override/final' instead of 'virtual' for overridden methods

Summary:
The patch is generated using clang-tidy misc-use-override check.

This command was used:

  tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
      -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix

  svn diff | clang-format-diff -i

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D8927

Modified:
    clang-tools-extra/trunk/clang-modernize/AddOverride/AddOverrideActions.h
    clang-tools-extra/trunk/clang-modernize/Core/IncludeDirectives.cpp
    clang-tools-extra/trunk/clang-modernize/Core/Transform.cpp
    clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopActions.h
    clang-tools-extra/trunk/clang-modernize/UseNullptr/NullptrActions.h
    clang-tools-extra/trunk/clang-query/Query.cpp
    clang-tools-extra/trunk/modularize/CoverageChecker.cpp
    clang-tools-extra/trunk/modularize/Modularize.cpp
    clang-tools-extra/trunk/modularize/PreprocessorTracker.cpp
    clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h
    clang-tools-extra/trunk/pp-trace/PPTrace.cpp
    clang-tools-extra/trunk/unittests/clang-modernize/IncludeDirectivesTest.cpp
    clang-tools-extra/trunk/unittests/clang-modernize/PerfSupportTest.cpp
    clang-tools-extra/trunk/unittests/clang-modernize/TransformTest.cpp

Modified: clang-tools-extra/trunk/clang-modernize/AddOverride/AddOverrideActions.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/AddOverride/AddOverrideActions.h?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/AddOverride/AddOverrideActions.h (original)
+++ clang-tools-extra/trunk/clang-modernize/AddOverride/AddOverrideActions.h Sat Apr 11 02:59:33 2015
@@ -31,7 +31,8 @@ public:
         Owner(Owner) {}
 
   /// \brief Entry point to the callback called when matches are made.
-  virtual void run(const clang::ast_matchers::MatchFinder::MatchResult &Result);
+  void
+  run(const clang::ast_matchers::MatchFinder::MatchResult &Result) override;
 
   void setPreprocessor(clang::Preprocessor &PP) { this->PP = &PP; }
 

Modified: clang-tools-extra/trunk/clang-modernize/Core/IncludeDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/Core/IncludeDirectives.cpp?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/Core/IncludeDirectives.cpp (original)
+++ clang-tools-extra/trunk/clang-modernize/Core/IncludeDirectives.cpp Sat Apr 11 02:59:33 2015
@@ -60,7 +60,7 @@ class IncludeDirectivesPPCallback : publ
 public:
   IncludeDirectivesPPCallback(IncludeDirectives *Self)
       : Self(Self), Guard(nullptr) {}
-  virtual ~IncludeDirectivesPPCallback() {}
+  ~IncludeDirectivesPPCallback() override {}
 
 private:
   void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
@@ -78,9 +78,9 @@ private:
   }
 
   // Keep track of the current file in the stack
-  virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason,
-                           SrcMgr::CharacteristicKind FileType,
-                           FileID PrevFID) override {
+  void FileChanged(SourceLocation Loc, FileChangeReason Reason,
+                   SrcMgr::CharacteristicKind FileType,
+                   FileID PrevFID) override {
     SourceManager &SM = Self->Sources;
     switch (Reason) {
     case EnterFile:
@@ -143,8 +143,8 @@ private:
     Self->HeaderToGuard[File] = Guard.DefineLoc;
   }
 
-  virtual void Ifndef(SourceLocation Loc, const Token &MacroNameTok,
-                      const MacroDirective *MD) override {
+  void Ifndef(SourceLocation Loc, const Token &MacroNameTok,
+              const MacroDirective *MD) override {
     Guard->Count++;
 
     // If this #ifndef is the top-most directive and the symbol isn't defined
@@ -160,8 +160,8 @@ private:
     }
   }
 
-  virtual void MacroDefined(const Token &MacroNameTok,
-                            const MacroDirective *MD) override {
+  void MacroDefined(const Token &MacroNameTok,
+                    const MacroDirective *MD) override {
     Guard->Count++;
 
     // If this #define is the second directive of the file and the symbol
@@ -196,28 +196,24 @@ private:
     Guard->EndifLoc = Loc;
   }
 
-  virtual void MacroExpands(const Token &, const MacroDirective *, SourceRange,
-                            const MacroArgs *) override {
+  void MacroExpands(const Token &, const MacroDirective *, SourceRange,
+                    const MacroArgs *) override {
     Guard->Count++;
   }
-  virtual void MacroUndefined(const Token &,
-                              const MacroDirective *) override {
+  void MacroUndefined(const Token &, const MacroDirective *) override {
     Guard->Count++;
   }
-  virtual void Defined(const Token &, const MacroDirective *,
-                       SourceRange) override {
+  void Defined(const Token &, const MacroDirective *, SourceRange) override {
     Guard->Count++;
   }
-  virtual void If(SourceLocation, SourceRange,
-                  ConditionValueKind) override {
+  void If(SourceLocation, SourceRange, ConditionValueKind) override {
     Guard->Count++;
   }
-  virtual void Elif(SourceLocation, SourceRange, ConditionValueKind,
-                    SourceLocation) override {
+  void Elif(SourceLocation, SourceRange, ConditionValueKind,
+            SourceLocation) override {
     Guard->Count++;
   }
-  virtual void Ifdef(SourceLocation, const Token &,
-                     const MacroDirective *) override {
+  void Ifdef(SourceLocation, const Token &, const MacroDirective *) override {
     Guard->Count++;
   }
   void Else(SourceLocation, SourceLocation) override {

Modified: clang-tools-extra/trunk/clang-modernize/Core/Transform.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/Core/Transform.cpp?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/Core/Transform.cpp (original)
+++ clang-tools-extra/trunk/clang-modernize/Core/Transform.cpp Sat Apr 11 02:59:33 2015
@@ -54,8 +54,8 @@ private:
       return Finder.newASTConsumer();
     }
 
-    virtual bool BeginSourceFileAction(CompilerInstance &CI,
-                                       StringRef Filename) override {
+    bool BeginSourceFileAction(CompilerInstance &CI,
+                               StringRef Filename) override {
       if (!ASTFrontendAction::BeginSourceFileAction(CI, Filename))
         return false;
 

Modified: clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopActions.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopActions.h?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopActions.h (original)
+++ clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopActions.h Sat Apr 11 02:59:33 2015
@@ -71,7 +71,8 @@ public:
         DeferredChanges(DeferredChanges), RejectedChanges(RejectedChanges),
         MaxRisk(MaxRisk), FixerKind(FixerKind), Owner(Owner) {}
 
-  virtual void run(const clang::ast_matchers::MatchFinder::MatchResult &Result);
+  void
+  run(const clang::ast_matchers::MatchFinder::MatchResult &Result) override;
 
 private:
   TUTrackingInfo &TUInfo;

Modified: clang-tools-extra/trunk/clang-modernize/UseNullptr/NullptrActions.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/UseNullptr/NullptrActions.h?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/UseNullptr/NullptrActions.h (original)
+++ clang-tools-extra/trunk/clang-modernize/UseNullptr/NullptrActions.h Sat Apr 11 02:59:33 2015
@@ -31,7 +31,8 @@ public:
                llvm::ArrayRef<llvm::StringRef> UserMacros, Transform &Owner);
 
   /// \brief Entry point to the callback called when matches are made.
-  virtual void run(const clang::ast_matchers::MatchFinder::MatchResult &Result);
+  void
+  run(const clang::ast_matchers::MatchFinder::MatchResult &Result) override;
 
 private:
   unsigned &AcceptedChanges;

Modified: clang-tools-extra/trunk/clang-query/Query.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-query/Query.cpp?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-query/Query.cpp (original)
+++ clang-tools-extra/trunk/clang-query/Query.cpp Sat Apr 11 02:59:33 2015
@@ -53,7 +53,7 @@ namespace {
 struct CollectBoundNodes : MatchFinder::MatchCallback {
   std::vector<BoundNodes> &Bindings;
   CollectBoundNodes(std::vector<BoundNodes> &Bindings) : Bindings(Bindings) {}
-  void run(const MatchFinder::MatchResult &Result) {
+  void run(const MatchFinder::MatchResult &Result) override {
     Bindings.push_back(Result.Nodes);
   }
 };

Modified: clang-tools-extra/trunk/modularize/CoverageChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/CoverageChecker.cpp?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/modularize/CoverageChecker.cpp (original)
+++ clang-tools-extra/trunk/modularize/CoverageChecker.cpp Sat Apr 11 02:59:33 2015
@@ -83,14 +83,14 @@ namespace sys = llvm::sys;
 class CoverageCheckerCallbacks : public PPCallbacks {
 public:
   CoverageCheckerCallbacks(CoverageChecker &Checker) : Checker(Checker) {}
-  ~CoverageCheckerCallbacks() {}
+  ~CoverageCheckerCallbacks() override {}
 
   // Include directive callback.
   void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
-    StringRef FileName, bool IsAngled,
-    CharSourceRange FilenameRange, const FileEntry *File,
-    StringRef SearchPath, StringRef RelativePath,
-    const Module *Imported) {
+                          StringRef FileName, bool IsAngled,
+                          CharSourceRange FilenameRange, const FileEntry *File,
+                          StringRef SearchPath, StringRef RelativePath,
+                          const Module *Imported) override {
     Checker.collectUmbrellaHeaderHeader(File->getName());
   }
 
@@ -129,7 +129,7 @@ public:
   CoverageCheckerFrontendActionFactory(CoverageChecker &Checker)
     : Checker(Checker) {}
 
-  virtual CoverageCheckerAction *create() {
+  CoverageCheckerAction *create() override {
     return new CoverageCheckerAction(Checker);
   }
 

Modified: clang-tools-extra/trunk/modularize/Modularize.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/Modularize.cpp?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/modularize/Modularize.cpp (original)
+++ clang-tools-extra/trunk/modularize/Modularize.cpp Sat Apr 11 02:59:33 2015
@@ -631,9 +631,9 @@ public:
     PPTracker.handlePreprocessorEntry(PP, InFile);
   }
 
-  ~CollectEntitiesConsumer() { PPTracker.handlePreprocessorExit(); }
+  ~CollectEntitiesConsumer() override { PPTracker.handlePreprocessorExit(); }
 
-  virtual void HandleTranslationUnit(ASTContext &Ctx) {
+  void HandleTranslationUnit(ASTContext &Ctx) override {
     SourceManager &SM = Ctx.getSourceManager();
 
     // Collect declared entities.
@@ -691,7 +691,7 @@ public:
       : Entities(Entities), PPTracker(preprocessorTracker),
         HadErrors(HadErrors) {}
 
-  virtual CollectEntitiesAction *create() {
+  CollectEntitiesAction *create() override {
     return new CollectEntitiesAction(Entities, PPTracker, HadErrors);
   }
 

Modified: clang-tools-extra/trunk/modularize/PreprocessorTracker.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/PreprocessorTracker.cpp?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/modularize/PreprocessorTracker.cpp (original)
+++ clang-tools-extra/trunk/modularize/PreprocessorTracker.cpp Sat Apr 11 02:59:33 2015
@@ -747,7 +747,7 @@ public:
   PreprocessorCallbacks(PreprocessorTrackerImpl &ppTracker,
                         clang::Preprocessor &PP, llvm::StringRef rootHeaderFile)
       : PPTracker(ppTracker), PP(PP), RootHeaderFile(rootHeaderFile) {}
-  ~PreprocessorCallbacks() {}
+  ~PreprocessorCallbacks() override {}
 
   // Overridden handlers.
   void InclusionDirective(clang::SourceLocation HashLoc,
@@ -757,24 +757,26 @@ public:
                           const clang::FileEntry *File,
                           llvm::StringRef SearchPath,
                           llvm::StringRef RelativePath,
-                          const clang::Module *Imported);
+                          const clang::Module *Imported) override;
   void FileChanged(clang::SourceLocation Loc,
                    clang::PPCallbacks::FileChangeReason Reason,
                    clang::SrcMgr::CharacteristicKind FileType,
-                   clang::FileID PrevFID = clang::FileID());
+                   clang::FileID PrevFID = clang::FileID()) override;
   void MacroExpands(const clang::Token &MacroNameTok,
                     const clang::MacroDirective *MD, clang::SourceRange Range,
-                    const clang::MacroArgs *Args);
+                    const clang::MacroArgs *Args) override;
   void Defined(const clang::Token &MacroNameTok,
-               const clang::MacroDirective *MD, clang::SourceRange Range);
+               const clang::MacroDirective *MD,
+               clang::SourceRange Range) override;
   void If(clang::SourceLocation Loc, clang::SourceRange ConditionRange,
-          clang::PPCallbacks::ConditionValueKind ConditionResult);
+          clang::PPCallbacks::ConditionValueKind ConditionResult) override;
   void Elif(clang::SourceLocation Loc, clang::SourceRange ConditionRange,
-            clang::PPCallbacks::ConditionValueKind ConditionResult, clang::SourceLocation IfLoc);
+            clang::PPCallbacks::ConditionValueKind ConditionResult,
+            clang::SourceLocation IfLoc) override;
   void Ifdef(clang::SourceLocation Loc, const clang::Token &MacroNameTok,
-             const clang::MacroDirective *MD);
+             const clang::MacroDirective *MD) override;
   void Ifndef(clang::SourceLocation Loc, const clang::Token &MacroNameTok,
-              const clang::MacroDirective *MD);
+              const clang::MacroDirective *MD) override;
 
 private:
   PreprocessorTrackerImpl &PPTracker;
@@ -811,11 +813,11 @@ public:
     }
   }
 
-  ~PreprocessorTrackerImpl() {}
+  ~PreprocessorTrackerImpl() override {}
 
   // Handle entering a preprocessing session.
   void handlePreprocessorEntry(clang::Preprocessor &PP,
-                               llvm::StringRef rootHeaderFile) {
+                               llvm::StringRef rootHeaderFile) override {
     HeadersInThisCompile.clear();
     assert((HeaderStack.size() == 0) && "Header stack should be empty.");
     pushHeaderHandle(addHeader(rootHeaderFile));
@@ -823,14 +825,15 @@ public:
                                                                rootHeaderFile));
   }
   // Handle exiting a preprocessing session.
-  void handlePreprocessorExit() { HeaderStack.clear(); }
+  void handlePreprocessorExit() override { HeaderStack.clear(); }
 
   // Handle include directive.
   // This function is called every time an include directive is seen by the
   // preprocessor, for the purpose of later checking for 'extern "" {}' or
   // "namespace {}" blocks containing #include directives.
   void handleIncludeDirective(llvm::StringRef DirectivePath, int DirectiveLine,
-                              int DirectiveColumn, llvm::StringRef TargetPath) {
+                              int DirectiveColumn,
+                              llvm::StringRef TargetPath) override {
     // If it's not a header in the header list, ignore it with respect to
     // the check.
     if (BlockCheckHeaderListOnly && !isHeaderListHeader(TargetPath))
@@ -855,7 +858,7 @@ public:
   bool checkForIncludesInBlock(clang::Preprocessor &PP,
                                clang::SourceRange BlockSourceRange,
                                const char *BlockIdentifierMessage,
-                               llvm::raw_ostream &OS) {
+                               llvm::raw_ostream &OS) override {
     clang::SourceLocation BlockStartLoc = BlockSourceRange.getBegin();
     clang::SourceLocation BlockEndLoc = BlockSourceRange.getEnd();
     // Use block location to get FileID of both the include directive
@@ -1139,7 +1142,7 @@ public:
 
   // Report on inconsistent macro instances.
   // Returns true if any mismatches.
-  bool reportInconsistentMacros(llvm::raw_ostream &OS) {
+  bool reportInconsistentMacros(llvm::raw_ostream &OS) override {
     bool ReturnValue = false;
     // Walk all the macro expansion trackers in the map.
     for (MacroExpansionMapIter I = MacroExpansions.begin(),
@@ -1200,7 +1203,7 @@ public:
 
   // Report on inconsistent conditional instances.
   // Returns true if any mismatches.
-  bool reportInconsistentConditionals(llvm::raw_ostream &OS) {
+  bool reportInconsistentConditionals(llvm::raw_ostream &OS) override {
     bool ReturnValue = false;
     // Walk all the conditional trackers in the map.
     for (ConditionalExpansionMapIter I = ConditionalExpansions.begin(),

Modified: clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h (original)
+++ clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h Sat Apr 11 02:59:33 2015
@@ -76,7 +76,7 @@ public:
                      std::vector<CallbackCall> &CallbackCalls,
                      clang::Preprocessor &PP);
 
-  virtual ~PPCallbacksTracker();
+  ~PPCallbacksTracker() override;
 
   // Overidden callback functions.
 

Modified: clang-tools-extra/trunk/pp-trace/PPTrace.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/pp-trace/PPTrace.cpp?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/pp-trace/PPTrace.cpp (original)
+++ clang-tools-extra/trunk/pp-trace/PPTrace.cpp Sat Apr 11 02:59:33 2015
@@ -139,7 +139,7 @@ public:
                                std::vector<CallbackCall> &CallbackCalls)
       : Ignore(Ignore), CallbackCalls(CallbackCalls) {}
 
-  virtual PPTraceAction *create() {
+  PPTraceAction *create() override {
     return new PPTraceAction(Ignore, CallbackCalls);
   }
 

Modified: clang-tools-extra/trunk/unittests/clang-modernize/IncludeDirectivesTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-modernize/IncludeDirectivesTest.cpp?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-modernize/IncludeDirectivesTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-modernize/IncludeDirectivesTest.cpp Sat Apr 11 02:59:33 2015
@@ -82,8 +82,8 @@ public:
   }
 
 private:
-  virtual bool BeginSourceFileAction(CompilerInstance &CI,
-                                     StringRef FileName) override {
+  bool BeginSourceFileAction(CompilerInstance &CI,
+                             StringRef FileName) override {
     if (!PreprocessOnlyAction::BeginSourceFileAction(CI, FileName))
       return false;
     VFHelper.mapVirtualFiles(CI.getSourceManager());
@@ -95,7 +95,7 @@ private:
     return true;
   }
 
-  virtual void EndSourceFileAction() override {
+  void EndSourceFileAction() override {
     const tooling::Replacement &Replace =
         FileIncludes->addAngledInclude(FileToModify, Include);
     if (Replace.isApplicable())

Modified: clang-tools-extra/trunk/unittests/clang-modernize/PerfSupportTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-modernize/PerfSupportTest.cpp?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-modernize/PerfSupportTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-modernize/PerfSupportTest.cpp Sat Apr 11 02:59:33 2015
@@ -18,8 +18,8 @@ public:
   TransformA(const TransformOptions &Options)
       : Transform("TransformA", Options) {}
 
-  virtual int apply(const tooling::CompilationDatabase &,
-                    const std::vector<std::string> &) {
+  int apply(const tooling::CompilationDatabase &,
+            const std::vector<std::string> &) override {
     return 0;
   }
 
@@ -33,8 +33,8 @@ public:
   TransformB(const TransformOptions &Options)
       : Transform("TransformB", Options) {}
 
-  virtual int apply(const tooling::CompilationDatabase &,
-                    const std::vector<std::string> &) {
+  int apply(const tooling::CompilationDatabase &,
+            const std::vector<std::string> &) override {
     return 0;
   }
 

Modified: clang-tools-extra/trunk/unittests/clang-modernize/TransformTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-modernize/TransformTest.cpp?rev=234681&r1=234680&r2=234681&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-modernize/TransformTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-modernize/TransformTest.cpp Sat Apr 11 02:59:33 2015
@@ -25,8 +25,10 @@ public:
   DummyTransform(llvm::StringRef Name, const TransformOptions &Options)
       : Transform(Name, Options) {}
 
-  virtual int apply(const tooling::CompilationDatabase &,
-                    const std::vector<std::string> &) { return 0; }
+  int apply(const tooling::CompilationDatabase &,
+            const std::vector<std::string> &) override {
+    return 0;
+  }
 
   void setAcceptedChanges(unsigned Changes) {
     Transform::setAcceptedChanges(Changes);
@@ -73,7 +75,7 @@ class TimePassingASTConsumer : public AS
 public:
   TimePassingASTConsumer(bool *Called) : Called(Called) {}
 
-  virtual bool HandleTopLevelDecl(DeclGroupRef DeclGroup) {
+  bool HandleTopLevelDecl(DeclGroupRef DeclGroup) override {
     llvm::sys::TimeValue UserStart;
     llvm::sys::TimeValue SystemStart;
     llvm::sys::TimeValue UserNow;
@@ -102,13 +104,11 @@ struct ConsumerFactory {
 struct CallbackForwarder : public clang::tooling::SourceFileCallbacks {
   CallbackForwarder(Transform &Callee) : Callee(Callee) {}
 
-  virtual bool handleBeginSource(CompilerInstance &CI, StringRef Filename) {
+  bool handleBeginSource(CompilerInstance &CI, StringRef Filename) override {
     return Callee.handleBeginSource(CI, Filename);
   }
 
-  virtual void handleEndSource() {
-    Callee.handleEndSource();
-  }
+  void handleEndSource() override { Callee.handleEndSource(); }
 
   Transform &Callee;
 };
@@ -184,8 +184,8 @@ public:
   ModifiableCallback(const Transform &Owner)
       : Owner(Owner) {}
 
-  virtual void
-  run(const clang::ast_matchers::MatchFinder::MatchResult &Result) {
+  void
+  run(const clang::ast_matchers::MatchFinder::MatchResult &Result) override {
     const VarDecl *Decl = Result.Nodes.getNodeAs<VarDecl>("decl");
     ASSERT_TRUE(Decl != nullptr);
 





More information about the cfe-commits mailing list