[clang][NFC] Add 'override' keyword to virtual function overrides
authorLogan Smith <logan.r.smith0@gmail.com>
Tue, 14 Jul 2020 15:53:59 +0000 (08:53 -0700)
committerLogan Smith <logan.r.smith0@gmail.com>
Tue, 14 Jul 2020 15:59:57 +0000 (08:59 -0700)
This patch adds override to several overriding virtual functions that were missing the keyword within the clang/ directory. These were found by the new -Wsuggest-override.

clang/include/clang/AST/DeclOpenMP.h
clang/lib/AST/Interp/InterpFrame.h
clang/lib/AST/OSLog.cpp
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
clang/lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp
clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp

index 437feaba28fb783bcfa016d18784c52ae7ecf2df..154ecb977692caeb1afa3d3e6870bbaa68754f18 100644 (file)
@@ -129,7 +129,7 @@ private:
   /// the declare reduction construct is declared inside compound statement.
   LazyDeclPtr PrevDeclInScope;
 
-  virtual void anchor();
+  void anchor() override;
 
   OMPDeclareReductionDecl(Kind DK, DeclContext *DC, SourceLocation L,
                           DeclarationName Name, QualType Ty,
@@ -228,7 +228,7 @@ class OMPDeclareMapperDecl final : public ValueDecl, public DeclContext {
 
   LazyDeclPtr PrevDeclInScope;
 
-  virtual void anchor();
+  void anchor() override;
 
   OMPDeclareMapperDecl(Kind DK, DeclContext *DC, SourceLocation L,
                        DeclarationName Name, QualType Ty,
index b8391b0bcf92c2f2aae8c35d80025289ef577c94..304e2ad66537bd29ea3bef5f3bada57a438787fe 100644 (file)
@@ -45,16 +45,16 @@ public:
   void popArgs();
 
   /// Describes the frame with arguments for diagnostic purposes.
-  void describe(llvm::raw_ostream &OS);
+  void describe(llvm::raw_ostream &OS) override;
 
   /// Returns the parent frame object.
-  Frame *getCaller() const;
+  Frame *getCaller() const override;
 
   /// Returns the location of the call to the frame.
-  SourceLocation getCallLocation() const;
+  SourceLocation getCallLocation() const override;
 
   /// Returns the caller.
-  const FunctionDecl *getCallee() const;
+  const FunctionDecl *getCallee() const override;
 
   /// Returns the current function.
   Function *getFunction() const { return Func; }
index df2f808728cfb37a989a73d6aadc660aec408abc..094c0102854b191cd62e2e4cd9ac59d92fced1c0 100644 (file)
@@ -55,9 +55,9 @@ public:
     ArgsData.reserve(Args.size());
   }
 
-  virtual bool HandlePrintfSpecifier(const analyze_printf::PrintfSpecifier &FS,
-                                     const char *StartSpecifier,
-                                     unsigned SpecifierLen) {
+  bool HandlePrintfSpecifier(const analyze_printf::PrintfSpecifier &FS,
+                             const char *StartSpecifier,
+                             unsigned SpecifierLen) override {
     if (!FS.consumesDataArgument() &&
         FS.getConversionSpecifier().getKind() !=
             clang::analyze_format_string::ConversionSpecifier::PrintErrno)
index af04b75392f59217b56adb580d8d28b26cc86240..cfa362bef1b1c3bc255747d5561e589656829aa3 100644 (file)
@@ -821,7 +821,7 @@ class LLVM_LIBRARY_VISIBILITY WebAssemblyOSTargetInfo
     : public OSTargetInfo<Target> {
 protected:
   void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
-                    MacroBuilder &Builder) const {
+                    MacroBuilder &Builder) const override {
     // A common platform macro.
     if (Opts.POSIXThreads)
       Builder.defineMacro("_REENTRANT");
index 515a2e9690ed19ad51f1abc77a8ce16dab372e06..22bf35dbd0cb0c67171463c08051f9c4bd3508b8 100644 (file)
@@ -1066,7 +1066,7 @@ static IsTupleLike isTupleLike(Sema &S, SourceLocation Loc, QualType T,
     TemplateArgumentListInfo &Args;
     ICEDiagnoser(LookupResult &R, TemplateArgumentListInfo &Args)
         : R(R), Args(Args) {}
-    void diagnoseNotICE(Sema &S, SourceLocation Loc, SourceRange SR) {
+    void diagnoseNotICE(Sema &S, SourceLocation Loc, SourceRange SR) override {
       S.Diag(Loc, diag::err_decomp_decl_std_tuple_size_not_constant)
           << printTemplateArgs(S.Context.getPrintingPolicy(), Args);
     }
index 43f7dcd14b01414e61a0b023354bd821bc348cca..87477e96d2d169ba92ea73b69bdf06cdcb38673f 100644 (file)
@@ -66,7 +66,7 @@ public:
   ProgramStateRef evalAssume(ProgramStateRef state, SVal Cond,
                              bool Assumption) const;
   void printState(raw_ostream &Out, ProgramStateRef State,
-                  const char *NL, const char *Sep) const;
+                  const char *NL, const char *Sep) const override;
 
 private:
   typedef std::pair<SymbolRef, const AllocationState*> AllocationPair;
index abeca596d056b3d7560a3d6d326cc0127c052721..df01cc760e7e924242a287c79e874332819ac477 100644 (file)
@@ -57,7 +57,7 @@ public:
   Callback(const NumberObjectConversionChecker *C,
            BugReporter &BR, AnalysisDeclContext *ADC)
       : C(C), BR(BR), ADC(ADC) {}
-  virtual void run(const MatchFinder::MatchResult &Result);
+  void run(const MatchFinder::MatchResult &Result) override;
 };
 } // end of anonymous namespace
 
index ff19d7a2b9d4c4369c3a7ed711ed9964dfe554c1..8c2008a7ceb4475348ed99cacb4801420d5e6354 100644 (file)
@@ -58,7 +58,7 @@ public:
                                      PointerEscapeKind Kind) const;
 
   void printState(raw_ostream &OS, ProgramStateRef State,
-                  const char *NL, const char *Sep) const;
+                  const char *NL, const char *Sep) const override;
 };
 } // end anonymous namespace