logan-5 created this revision. logan-5 added a project: clang. Herald added subscribers: cfe-commits, martong.
This patch adds `override` to several overriding virtual functions that were missing the keyword within the clang/ directory. NFC. These were found by a Clang build equipped with `-Wsuggest-override`, as implemented in this patch <https://reviews.llvm.org/D82728> (D82728 <https://reviews.llvm.org/D82728>). Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D83611 Files: 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: clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp @@ -58,7 +58,7 @@ 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 Index: clang/lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp @@ -57,7 +57,7 @@ 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: clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp @@ -66,7 +66,7 @@ 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: clang/lib/Sema/SemaDeclCXX.cpp =================================================================== --- clang/lib/Sema/SemaDeclCXX.cpp +++ clang/lib/Sema/SemaDeclCXX.cpp @@ -1066,7 +1066,7 @@ 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: clang/lib/Basic/Targets/OSTargets.h =================================================================== --- clang/lib/Basic/Targets/OSTargets.h +++ clang/lib/Basic/Targets/OSTargets.h @@ -821,7 +821,7 @@ : 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: clang/lib/AST/OSLog.cpp =================================================================== --- clang/lib/AST/OSLog.cpp +++ clang/lib/AST/OSLog.cpp @@ -55,9 +55,9 @@ 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: clang/lib/AST/Interp/InterpFrame.h =================================================================== --- clang/lib/AST/Interp/InterpFrame.h +++ clang/lib/AST/Interp/InterpFrame.h @@ -45,16 +45,16 @@ 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: clang/include/clang/AST/DeclOpenMP.h =================================================================== --- clang/include/clang/AST/DeclOpenMP.h +++ clang/include/clang/AST/DeclOpenMP.h @@ -129,7 +129,7 @@ /// 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 @@ LazyDeclPtr PrevDeclInScope; - virtual void anchor(); + void anchor() override; OMPDeclareMapperDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName Name, QualType Ty,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits