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

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: klimek, cfe-commits

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

llvm-svn: 234678
diff --git a/clang/unittests/Sema/ExternalSemaSourceTest.cpp b/clang/unittests/Sema/ExternalSemaSourceTest.cpp
index 3a93fc7..703e97b 100644
--- a/clang/unittests/Sema/ExternalSemaSourceTest.cpp
+++ b/clang/unittests/Sema/ExternalSemaSourceTest.cpp
@@ -30,7 +30,7 @@
 public:
   CompleteTypeDiagnoser(bool MockResult) : CallCount(0), Result(MockResult) {}
 
-  virtual bool MaybeDiagnoseMissingCompleteType(SourceLocation L, QualType T) {
+  bool MaybeDiagnoseMissingCompleteType(SourceLocation L, QualType T) override {
     ++CallCount;
     return Result;
   }
@@ -54,8 +54,8 @@
     ToNS.append("'");
   }
 
-  virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
-                                const Diagnostic &Info) {
+  void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
+                        const Diagnostic &Info) override {
     if (Chained)
       Chained->HandleDiagnostic(DiagLevel, Info);
     if (Info.getID() - 1 == diag::err_using_directive_member_suggest) {
@@ -66,13 +66,13 @@
     }
   }
 
-  virtual void clear() {
+  void clear() override {
     DiagnosticConsumer::clear();
     if (Chained)
       Chained->clear();
   }
 
-  virtual bool IncludeInDiagnosticCounts() const {
+  bool IncludeInDiagnosticCounts() const override {
     if (Chained)
       return Chained->IncludeInDiagnosticCounts();
     return false;
@@ -97,16 +97,15 @@
   NamespaceTypoProvider(StringRef From, StringRef To)
       : CorrectFrom(From), CorrectTo(To), CurrentSema(nullptr), CallCount(0) {}
 
-  virtual void InitializeSema(Sema &S) { CurrentSema = &S; }
+  void InitializeSema(Sema &S) override { CurrentSema = &S; }
 
-  virtual void ForgetSema() { CurrentSema = nullptr; }
+  void ForgetSema() override { CurrentSema = nullptr; }
 
-  virtual TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo,
-                                     int LookupKind, Scope *S, CXXScopeSpec *SS,
-                                     CorrectionCandidateCallback &CCC,
-                                     DeclContext *MemberContext,
-                                     bool EnteringContext,
-                                     const ObjCObjectPointerType *OPT) {
+  TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, int LookupKind,
+                             Scope *S, CXXScopeSpec *SS,
+                             CorrectionCandidateCallback &CCC,
+                             DeclContext *MemberContext, bool EnteringContext,
+                             const ObjCObjectPointerType *OPT) override {
     ++CallCount;
     if (CurrentSema && Typo.getName().getAsString() == CorrectFrom) {
       DeclContext *DestContext = nullptr;
@@ -140,13 +139,13 @@
   std::unique_ptr<DiagnosticConsumer> OwnedClient;
 
 protected:
-  virtual std::unique_ptr<clang::ASTConsumer>
+  std::unique_ptr<clang::ASTConsumer>
   CreateASTConsumer(clang::CompilerInstance &Compiler,
-                    llvm::StringRef /* dummy */) {
+                    llvm::StringRef /* dummy */) override {
     return llvm::make_unique<clang::ASTConsumer>();
   }
 
-  virtual void ExecuteAction() {
+  void ExecuteAction() override {
     CompilerInstance &CI = getCompilerInstance();
     ASSERT_FALSE(CI.hasSema());
     CI.createSema(getTranslationUnitKind(), nullptr);