Index: examples/PrintFunctionNames/PrintFunctionNames.cpp =================================================================== --- examples/PrintFunctionNames/PrintFunctionNames.cpp +++ examples/PrintFunctionNames/PrintFunctionNames.cpp @@ -23,7 +23,7 @@ class PrintFunctionsConsumer : public ASTConsumer { public: - virtual bool HandleTopLevelDecl(DeclGroupRef DG) { + bool HandleTopLevelDecl(DeclGroupRef DG) override { for (DeclGroupRef::iterator i = DG.begin(), e = DG.end(); i != e; ++i) { const Decl *D = *i; if (const NamedDecl *ND = dyn_cast(D)) @@ -37,12 +37,12 @@ class PrintFunctionNamesAction : public PluginASTAction { protected: std::unique_ptr CreateASTConsumer(CompilerInstance &CI, - llvm::StringRef) { + llvm::StringRef) override { return llvm::make_unique(); } bool ParseArgs(const CompilerInstance &CI, - const std::vector& args) { + const std::vector& args) override { for (unsigned i = 0, e = args.size(); i != e; ++i) { llvm::errs() << "PrintFunctionNames arg = " << args[i] << "\n"; Index: include/clang/AST/VTableBuilder.h =================================================================== --- include/clang/AST/VTableBuilder.h +++ include/clang/AST/VTableBuilder.h @@ -333,7 +333,7 @@ public: ItaniumVTableContext(ASTContext &Context); - ~ItaniumVTableContext(); + ~ItaniumVTableContext() override; const VTableLayout &getVTableLayout(const CXXRecordDecl *RD) { computeVTableRelatedInformation(RD); @@ -511,7 +511,7 @@ MicrosoftVTableContext(ASTContext &Context) : VTableContextBase(/*MS=*/true), Context(Context) {} - ~MicrosoftVTableContext(); + ~MicrosoftVTableContext() override; const VPtrInfoVector &getVFPtrOffsets(const CXXRecordDecl *RD); Index: include/clang/ASTMatchers/ASTMatchersInternal.h =================================================================== --- include/clang/ASTMatchers/ASTMatchersInternal.h +++ include/clang/ASTMatchers/ASTMatchersInternal.h @@ -209,7 +209,7 @@ template class MatcherInterface : public DynMatcherInterface { public: - virtual ~MatcherInterface() {} + ~MatcherInterface() override {} /// \brief Returns true if 'Node' can be matched. /// Index: include/clang/ASTMatchers/Dynamic/Parser.h =================================================================== --- include/clang/ASTMatchers/Dynamic/Parser.h +++ include/clang/ASTMatchers/Dynamic/Parser.h @@ -123,7 +123,7 @@ /// tokens. class RegistrySema : public Parser::Sema { public: - virtual ~RegistrySema(); + ~RegistrySema() override; llvm::Optional lookupMatcherCtor(StringRef MatcherName) override; Index: include/clang/ASTMatchers/Dynamic/VariantValue.h =================================================================== --- include/clang/ASTMatchers/Dynamic/VariantValue.h +++ include/clang/ASTMatchers/Dynamic/VariantValue.h @@ -122,7 +122,7 @@ /// It follows a similar interface as VariantMatcher itself. class Payload : public RefCountedBaseVPTR { public: - virtual ~Payload(); + ~Payload() override; virtual llvm::Optional getSingleMatcher() const = 0; virtual std::string getTypeAsString() const = 0; virtual llvm::Optional Index: include/clang/Analysis/Analyses/Dominators.h =================================================================== --- include/clang/Analysis/Analyses/Dominators.h +++ include/clang/Analysis/Analyses/Dominators.h @@ -44,7 +44,7 @@ DT = new llvm::DominatorTreeBase(false); } - ~DominatorTree() { + ~DominatorTree() override { delete DT; } Index: include/clang/Analysis/Analyses/LiveVariables.h =================================================================== --- include/clang/Analysis/Analyses/LiveVariables.h +++ include/clang/Analysis/Analyses/LiveVariables.h @@ -69,7 +69,7 @@ }; - virtual ~LiveVariables(); + ~LiveVariables() override; /// Compute the liveness information for a given CFG. static LiveVariables *computeLiveness(AnalysisDeclContext &analysisContext, Index: include/clang/Analysis/AnalysisContext.h =================================================================== --- include/clang/Analysis/AnalysisContext.h +++ include/clang/Analysis/AnalysisContext.h @@ -289,7 +289,7 @@ Block(blk), Index(idx) {} public: - ~StackFrameContext() {} + ~StackFrameContext() override {} const Stmt *getCallSite() const { return CallSite; } @@ -324,7 +324,7 @@ : LocationContext(Scope, ctx, parent), Enter(s) {} public: - ~ScopeContext() {} + ~ScopeContext() override {} void Profile(llvm::FoldingSetNodeID &ID) override; @@ -352,7 +352,7 @@ : LocationContext(Block, ctx, parent), BD(bd), ContextData(contextData) {} public: - ~BlockInvocationContext() {} + ~BlockInvocationContext() override {} const BlockDecl *getBlockDecl() const { return BD; } Index: include/clang/Basic/Diagnostic.h =================================================================== --- include/clang/Basic/Diagnostic.h +++ include/clang/Basic/Diagnostic.h @@ -1371,7 +1371,7 @@ public: ForwardingDiagnosticConsumer(DiagnosticConsumer &Target) : Target(Target) {} - virtual ~ForwardingDiagnosticConsumer(); + ~ForwardingDiagnosticConsumer() override; void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override; Index: include/clang/CodeGen/CodeGenAction.h =================================================================== --- include/clang/CodeGen/CodeGenAction.h +++ include/clang/CodeGen/CodeGenAction.h @@ -45,7 +45,7 @@ void EndSourceFileAction() override; public: - ~CodeGenAction(); + ~CodeGenAction() override; /// setLinkModule - Set the link module to be used by this action. If a link /// module is not provided, and CodeGenOptions::LinkBitcodeFile is non-empty, Index: include/clang/Driver/Job.h =================================================================== --- include/clang/Driver/Job.h +++ include/clang/Driver/Job.h @@ -175,7 +175,7 @@ public: JobList(); - virtual ~JobList() {} + ~JobList() override {} void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo = nullptr) const override; Index: include/clang/Frontend/ASTUnit.h =================================================================== --- include/clang/Frontend/ASTUnit.h +++ include/clang/Frontend/ASTUnit.h @@ -485,7 +485,7 @@ }; friend class ConcurrencyCheck; - ~ASTUnit(); + ~ASTUnit() override; bool isMainFileAST() const { return MainFileIsAST; } Index: include/clang/Frontend/CompilerInstance.h =================================================================== --- include/clang/Frontend/CompilerInstance.h +++ include/clang/Frontend/CompilerInstance.h @@ -165,7 +165,7 @@ void operator=(const CompilerInstance &) = delete; public: explicit CompilerInstance(bool BuildingModule = false); - ~CompilerInstance(); + ~CompilerInstance() override; /// @name High-Level Operations /// { Index: include/clang/Frontend/DiagnosticRenderer.h =================================================================== --- include/clang/Frontend/DiagnosticRenderer.h +++ include/clang/Frontend/DiagnosticRenderer.h @@ -156,7 +156,7 @@ DiagnosticOptions *DiagOpts) : DiagnosticRenderer(LangOpts, DiagOpts) {} - virtual ~DiagnosticNoteRenderer(); + ~DiagnosticNoteRenderer() override; void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc, const SourceManager &SM) override; Index: include/clang/Frontend/FrontendActions.h =================================================================== --- include/clang/Frontend/FrontendActions.h +++ include/clang/Frontend/FrontendActions.h @@ -188,7 +188,7 @@ public: ASTMergeAction(FrontendAction *AdaptedAction, ArrayRef ASTFiles); - virtual ~ASTMergeAction(); + ~ASTMergeAction() override; bool usesPreprocessorOnly() const override; TranslationUnitKind getTranslationUnitKind() override; Index: include/clang/Frontend/MultiplexConsumer.h =================================================================== --- include/clang/Frontend/MultiplexConsumer.h +++ include/clang/Frontend/MultiplexConsumer.h @@ -30,7 +30,7 @@ public: // Takes ownership of the pointers in C. MultiplexConsumer(std::vector> C); - ~MultiplexConsumer(); + ~MultiplexConsumer() override; // ASTConsumer void Initialize(ASTContext &Context) override; Index: include/clang/Frontend/TextDiagnostic.h =================================================================== --- include/clang/Frontend/TextDiagnostic.h +++ include/clang/Frontend/TextDiagnostic.h @@ -40,7 +40,7 @@ const LangOptions &LangOpts, DiagnosticOptions *DiagOpts); - virtual ~TextDiagnostic(); + ~TextDiagnostic() override; /// \brief Print the diagonstic level to a raw_ostream. /// Index: include/clang/Frontend/TextDiagnosticPrinter.h =================================================================== --- include/clang/Frontend/TextDiagnosticPrinter.h +++ include/clang/Frontend/TextDiagnosticPrinter.h @@ -40,7 +40,7 @@ public: TextDiagnosticPrinter(raw_ostream &os, DiagnosticOptions *diags, bool OwnsOutputStream = false); - virtual ~TextDiagnosticPrinter(); + ~TextDiagnosticPrinter() override; /// setPrefix - Set the diagnostic printer prefix string, which will be /// printed at the start of any diagnostics. If empty, no prefix string is Index: include/clang/Frontend/VerifyDiagnosticConsumer.h =================================================================== --- include/clang/Frontend/VerifyDiagnosticConsumer.h +++ include/clang/Frontend/VerifyDiagnosticConsumer.h @@ -246,7 +246,7 @@ /// the currently-attached diagnostic client when a diagnostic does not match /// what is expected (as indicated in the source file). VerifyDiagnosticConsumer(DiagnosticsEngine &Diags); - ~VerifyDiagnosticConsumer(); + ~VerifyDiagnosticConsumer() override; void BeginSourceFile(const LangOptions &LangOpts, const Preprocessor *PP) override; Index: include/clang/Lex/PTHLexer.h =================================================================== --- include/clang/Lex/PTHLexer.h +++ include/clang/Lex/PTHLexer.h @@ -65,7 +65,7 @@ const unsigned char* ppcond, PTHManager &PM); public: - ~PTHLexer() {} + ~PTHLexer() override {} /// Lex - Return the next token. bool Lex(Token &Tok); Index: include/clang/Lex/PTHManager.h =================================================================== --- include/clang/Lex/PTHManager.h +++ include/clang/Lex/PTHManager.h @@ -113,7 +113,7 @@ // The current PTH version. enum { Version = 10 }; - ~PTHManager(); + ~PTHManager() override; /// getOriginalSourceFile - Return the full path to the original header /// file name that was used to generate the PTH cache. Index: include/clang/Lex/Pragma.h =================================================================== --- include/clang/Lex/Pragma.h +++ include/clang/Lex/Pragma.h @@ -93,7 +93,7 @@ llvm::StringMap Handlers; public: explicit PragmaNamespace(StringRef Name) : PragmaHandler(Name) {} - virtual ~PragmaNamespace(); + ~PragmaNamespace() override; /// FindHandler - Check to see if there is already a handler for the /// specified name. If not, return the handler for the null name if it Index: include/clang/Parse/Parser.h =================================================================== --- include/clang/Parse/Parser.h +++ include/clang/Parse/Parser.h @@ -235,7 +235,7 @@ public: Parser(Preprocessor &PP, Sema &Actions, bool SkipFunctionBodies); - ~Parser(); + ~Parser() override; const LangOptions &getLangOpts() const { return PP.getLangOpts(); } const TargetInfo &getTargetInfo() const { return PP.getTargetInfo(); } @@ -887,7 +887,7 @@ class LateParsedClass : public LateParsedDeclaration { public: LateParsedClass(Parser *P, ParsingClass *C); - virtual ~LateParsedClass(); + ~LateParsedClass() override; void ParseLexedMethodDeclarations() override; void ParseLexedMemberInitializers() override; Index: include/clang/Rewrite/Frontend/FixItRewriter.h =================================================================== --- include/clang/Rewrite/Frontend/FixItRewriter.h +++ include/clang/Rewrite/Frontend/FixItRewriter.h @@ -86,7 +86,7 @@ const LangOptions &LangOpts, FixItOptions *FixItOpts); /// \brief Destroy the fix-it rewriter. - ~FixItRewriter(); + ~FixItRewriter() override; /// \brief Check whether there are modifications for a given file. bool IsModified(FileID ID) const { Index: include/clang/Rewrite/Frontend/FrontendActions.h =================================================================== --- include/clang/Rewrite/Frontend/FrontendActions.h +++ include/clang/Rewrite/Frontend/FrontendActions.h @@ -43,7 +43,7 @@ public: FixItAction(); - ~FixItAction(); + ~FixItAction() override; }; /// \brief Emits changes to temporary files and uses them for the original Index: include/clang/Sema/ExternalSemaSource.h =================================================================== --- include/clang/Sema/ExternalSemaSource.h +++ include/clang/Sema/ExternalSemaSource.h @@ -55,7 +55,7 @@ ExternalASTSource::SemaSource = true; } - ~ExternalSemaSource(); + ~ExternalSemaSource() override; /// \brief Initialize the semantic source with the Sema instance /// being used to perform semantic analysis on the abstract syntax Index: include/clang/Sema/MultiplexExternalSemaSource.h =================================================================== --- include/clang/Sema/MultiplexExternalSemaSource.h +++ include/clang/Sema/MultiplexExternalSemaSource.h @@ -51,7 +51,7 @@ /// MultiplexExternalSemaSource(ExternalSemaSource& s1, ExternalSemaSource& s2); - ~MultiplexExternalSemaSource(); + ~MultiplexExternalSemaSource() override; ///\brief Appends new source to the source list. /// Index: include/clang/Sema/ScopeInfo.h =================================================================== --- include/clang/Sema/ScopeInfo.h +++ include/clang/Sema/ScopeInfo.h @@ -568,7 +568,7 @@ Kind = SK_Block; } - virtual ~BlockScopeInfo(); + ~BlockScopeInfo() override; static bool classof(const FunctionScopeInfo *FSI) { return FSI->Kind == SK_Block; @@ -599,7 +599,7 @@ Kind = SK_CapturedRegion; } - virtual ~CapturedRegionScopeInfo(); + ~CapturedRegionScopeInfo() override; /// \brief A descriptive name for the kind of captured region this is. StringRef getRegionName() const { @@ -704,7 +704,7 @@ Kind = SK_Lambda; } - virtual ~LambdaScopeInfo(); + ~LambdaScopeInfo() override; /// \brief Note when all explicit captures have been added. void finishedExplicitCaptures() { Index: include/clang/Serialization/ASTReader.h =================================================================== --- include/clang/Serialization/ASTReader.h +++ include/clang/Serialization/ASTReader.h @@ -1323,7 +1323,7 @@ bool ValidateSystemInputs = false, bool UseGlobalIndex = true); - ~ASTReader(); + ~ASTReader() override; SourceManager &getSourceManager() const { return SourceMgr; } FileManager &getFileManager() const { return FileMgr; } Index: include/clang/Serialization/ASTWriter.h =================================================================== --- include/clang/Serialization/ASTWriter.h +++ include/clang/Serialization/ASTWriter.h @@ -559,7 +559,7 @@ /// \brief Create a new precompiled header writer that outputs to /// the given bitstream. ASTWriter(llvm::BitstreamWriter &Stream); - ~ASTWriter(); + ~ASTWriter() override; const LangOptions &getLangOpts() const; @@ -882,7 +882,7 @@ clang::Module *Module, StringRef isysroot, raw_ostream *Out, bool AllowASTWithErrors = false); - ~PCHGenerator(); + ~PCHGenerator() override; void InitializeSema(Sema &S) override { SemaPtr = &S; } void HandleTranslationUnit(ASTContext &Ctx) override; ASTMutationListener *GetASTMutationListener() override; Index: include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h =================================================================== --- include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h +++ include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h @@ -492,7 +492,7 @@ GRBugReporter(BugReporterData& d, ExprEngine& eng) : BugReporter(d, GRBugReporterKind), Eng(eng) {} - virtual ~GRBugReporter(); + ~GRBugReporter() override; /// getEngine - Return the analysis engine used to analyze a given /// function or method. Index: include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h =================================================================== --- include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h +++ include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h @@ -366,7 +366,7 @@ PathDiagnosticPiece(Kind k, DisplayHint hint = Below); public: - virtual ~PathDiagnosticPiece(); + ~PathDiagnosticPiece() override; StringRef getString() const { return str; } @@ -482,7 +482,7 @@ public: StackHintGeneratorForSymbol(SymbolRef S, StringRef M) : Sym(S), Msg(M) {} - virtual ~StackHintGeneratorForSymbol() {} + ~StackHintGeneratorForSymbol() override {} /// \brief Search the call expression for the symbol Sym and dispatch the /// 'getMessageForX()' methods to construct a specific message. @@ -515,7 +515,7 @@ : PathDiagnosticSpotPiece(pos, s, Event, addPosRange), CallStackHint(stackHint) {} - ~PathDiagnosticEventPiece(); + ~PathDiagnosticEventPiece() override; /// Mark the diagnostic piece as being potentially prunable. This /// flag may have been previously set, at which point it will not @@ -575,7 +575,7 @@ PathDiagnosticLocation callReturn; PathPieces path; - virtual ~PathDiagnosticCallPiece(); + ~PathDiagnosticCallPiece() override; const Decl *getCaller() const { return Caller; } @@ -635,7 +635,7 @@ LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos)); } - ~PathDiagnosticControlFlowPiece(); + ~PathDiagnosticControlFlowPiece() override; PathDiagnosticLocation getStartLocation() const { assert(!LPairs.empty() && @@ -690,7 +690,7 @@ PathDiagnosticMacroPiece(const PathDiagnosticLocation &pos) : PathDiagnosticSpotPiece(pos, "", Macro) {} - ~PathDiagnosticMacroPiece(); + ~PathDiagnosticMacroPiece() override; PathPieces subPieces; Index: include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h @@ -55,7 +55,7 @@ AnalyzerOptions &Options, CodeInjector* injector = nullptr); - ~AnalysisManager(); + ~AnalysisManager() override; void ClearContexts() { AnaCtxMgr.clear(); Index: include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h @@ -367,7 +367,7 @@ EnclosingBldr->takeNodes(*I); } - virtual ~StmtNodeBuilder(); + ~StmtNodeBuilder() override; using NodeBuilder::generateNode; using NodeBuilder::generateSink; Index: include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h @@ -102,7 +102,7 @@ FunctionSummariesTy *FS, InliningModes HowToInlineIn); - ~ExprEngine(); + ~ExprEngine() override; /// Returns true if there is still simulation state on the worklist. bool ExecuteWorkList(const LocationContext *L, unsigned Steps = 150000) { Index: include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h @@ -609,7 +609,7 @@ AnalysisDeclContext *getAnalysisDeclContext() const { return AC; } - virtual void dumpToStream(raw_ostream &os) const override; + void dumpToStream(raw_ostream &os) const override; void Profile(llvm::FoldingSetNodeID& ID) const override; Index: include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h @@ -109,7 +109,7 @@ SymbolData(Kind k, SymbolID sym) : SymExpr(k), Sym(sym) {} public: - virtual ~SymbolData() {} + ~SymbolData() override {} SymbolID getSymbolID() const { return Sym; } Index: include/clang/Tooling/Tooling.h =================================================================== --- include/clang/Tooling/Tooling.h +++ include/clang/Tooling/Tooling.h @@ -79,7 +79,7 @@ /// process each translation unit. class FrontendActionFactory : public ToolAction { public: - virtual ~FrontendActionFactory(); + ~FrontendActionFactory() override; /// \brief Invokes the compiler with a FrontendAction created by create(). bool runInvocation(clang::CompilerInvocation *Invocation, FileManager *Files, Index: lib/ARCMigrate/ARCMT.cpp =================================================================== --- lib/ARCMigrate/ARCMT.cpp +++ lib/ARCMigrate/ARCMT.cpp @@ -124,7 +124,7 @@ } } - virtual ~CaptureDiagnosticConsumer() { + ~CaptureDiagnosticConsumer() override { assert(!HasBegunSourceFile && "FinishCapture not called!"); } @@ -465,7 +465,7 @@ if (Listener) Listener->start(ctx); } - ~RewritesApplicator() { + ~RewritesApplicator() override { if (Listener) Listener->finish(); } Index: lib/ARCMigrate/ObjCMT.cpp =================================================================== --- lib/ARCMigrate/ObjCMT.cpp +++ lib/ARCMigrate/ObjCMT.cpp @@ -1790,7 +1790,7 @@ : SourceMgr(SM), OS(OS) { OS << "[\n"; } - ~JSONEditWriter() { + ~JSONEditWriter() override { OS << "]\n"; } Index: lib/ASTMatchers/ASTMatchFinder.cpp =================================================================== --- lib/ASTMatchers/ASTMatchFinder.cpp +++ lib/ASTMatchers/ASTMatchFinder.cpp @@ -300,7 +300,7 @@ const MatchFinder::MatchFinderOptions &Options) : Matchers(Matchers), Options(Options), ActiveASTContext(nullptr) {} - ~MatchASTVisitor() { + ~MatchASTVisitor() override { if (Options.CheckProfiling) { Options.CheckProfiling->Records = std::move(TimeByBucket); } Index: lib/ASTMatchers/Dynamic/Marshallers.h =================================================================== --- lib/ASTMatchers/Dynamic/Marshallers.h +++ lib/ASTMatchers/Dynamic/Marshallers.h @@ -181,18 +181,18 @@ ArgKinds(ArgKinds.begin(), ArgKinds.end()) {} VariantMatcher create(const SourceRange &NameRange, - ArrayRef Args, Diagnostics *Error) const { + ArrayRef Args, Diagnostics *Error) const override { return Marshaller(Func, MatcherName, NameRange, Args, Error); } - bool isVariadic() const { return false; } - unsigned getNumArgs() const { return ArgKinds.size(); } + bool isVariadic() const override { return false; } + unsigned getNumArgs() const override { return ArgKinds.size(); } void getArgKinds(ast_type_traits::ASTNodeKind ThisKind, unsigned ArgNo, - std::vector &Kinds) const { + std::vector &Kinds) const override { Kinds.push_back(ArgKinds[ArgNo]); } bool isConvertibleTo(ast_type_traits::ASTNodeKind Kind, unsigned *Specificity, - ast_type_traits::ASTNodeKind *LeastDerivedKind) const { + ast_type_traits::ASTNodeKind *LeastDerivedKind) const override { return isRetKindConvertibleTo(RetKinds, Kind, Specificity, LeastDerivedKind); } @@ -333,18 +333,18 @@ } VariantMatcher create(const SourceRange &NameRange, - ArrayRef Args, Diagnostics *Error) const { + ArrayRef Args, Diagnostics *Error) const override { return Func(MatcherName, NameRange, Args, Error); } - bool isVariadic() const { return true; } - unsigned getNumArgs() const { return 0; } + bool isVariadic() const override { return true; } + unsigned getNumArgs() const override { return 0; } void getArgKinds(ast_type_traits::ASTNodeKind ThisKind, unsigned ArgNo, - std::vector &Kinds) const { + std::vector &Kinds) const override { Kinds.push_back(ArgsKind); } bool isConvertibleTo(ast_type_traits::ASTNodeKind Kind, unsigned *Specificity, - ast_type_traits::ASTNodeKind *LeastDerivedKind) const { + ast_type_traits::ASTNodeKind *LeastDerivedKind) const override { return isRetKindConvertibleTo(RetKinds, Kind, Specificity, LeastDerivedKind); } @@ -487,11 +487,11 @@ OverloadedMatcherDescriptor(ArrayRef Callbacks) : Overloads(Callbacks.begin(), Callbacks.end()) {} - virtual ~OverloadedMatcherDescriptor() {} + ~OverloadedMatcherDescriptor() override {} - virtual VariantMatcher create(const SourceRange &NameRange, + VariantMatcher create(const SourceRange &NameRange, ArrayRef Args, - Diagnostics *Error) const { + Diagnostics *Error) const override { std::vector Constructed; Diagnostics::OverloadContext Ctx(Error); for (const auto &O : Overloads) { @@ -512,7 +512,7 @@ return Constructed[0]; } - bool isVariadic() const { + bool isVariadic() const override { bool Overload0Variadic = Overloads[0]->isVariadic(); #ifndef NDEBUG for (const auto &O : Overloads) { @@ -522,7 +522,7 @@ return Overload0Variadic; } - unsigned getNumArgs() const { + unsigned getNumArgs() const override { unsigned Overload0NumArgs = Overloads[0]->getNumArgs(); #ifndef NDEBUG for (const auto &O : Overloads) { @@ -533,7 +533,7 @@ } void getArgKinds(ast_type_traits::ASTNodeKind ThisKind, unsigned ArgNo, - std::vector &Kinds) const { + std::vector &Kinds) const override { for (const auto &O : Overloads) { if (O->isConvertibleTo(ThisKind)) O->getArgKinds(ThisKind, ArgNo, Kinds); @@ -541,7 +541,7 @@ } bool isConvertibleTo(ast_type_traits::ASTNodeKind Kind, unsigned *Specificity, - ast_type_traits::ASTNodeKind *LeastDerivedKind) const { + ast_type_traits::ASTNodeKind *LeastDerivedKind) const override { for (const auto &O : Overloads) { if (O->isConvertibleTo(Kind, Specificity, LeastDerivedKind)) return true; @@ -562,7 +562,7 @@ : MinCount(MinCount), MaxCount(MaxCount), Op(Op), MatcherName(MatcherName) {} - virtual VariantMatcher create(const SourceRange &NameRange, + VariantMatcher create(const SourceRange &NameRange, ArrayRef Args, Diagnostics *Error) const override { if (Args.size() < MinCount || MaxCount < Args.size()) { Index: lib/Analysis/CFG.cpp =================================================================== --- lib/Analysis/CFG.cpp +++ lib/Analysis/CFG.cpp @@ -3952,7 +3952,7 @@ } - virtual ~StmtPrinterHelper() {} + ~StmtPrinterHelper() override {} const LangOptions &getLangOpts() const { return LangOpts; } void setBlockID(signed i) { currentBlock = i; } Index: lib/Analysis/UninitializedValues.cpp =================================================================== --- lib/Analysis/UninitializedValues.cpp +++ lib/Analysis/UninitializedValues.cpp @@ -837,7 +837,7 @@ : hadUse(numBlocks, false), hadAnyUse(false), currentBlock(0) {} - virtual ~PruneBlocksHandler() {} + ~PruneBlocksHandler() override {} /// Records if a CFGBlock had a potential use of an uninitialized variable. llvm::BitVector hadUse; Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -4570,8 +4570,8 @@ public: ARMleTargetInfo(const llvm::Triple &Triple) : ARMTargetInfo(Triple, false) { } - virtual void getTargetDefines(const LangOptions &Opts, - MacroBuilder &Builder) const { + void getTargetDefines(const LangOptions &Opts, + MacroBuilder &Builder) const override { Builder.defineMacro("__ARMEL__"); ARMTargetInfo::getTargetDefines(Opts, Builder); } @@ -4581,8 +4581,8 @@ public: ARMbeTargetInfo(const llvm::Triple &Triple) : ARMTargetInfo(Triple, true) { } - virtual void getTargetDefines(const LangOptions &Opts, - MacroBuilder &Builder) const { + void getTargetDefines(const LangOptions &Opts, + MacroBuilder &Builder) const override { Builder.defineMacro("__ARMEB__"); Builder.defineMacro("__ARM_BIG_ENDIAN"); ARMTargetInfo::getTargetDefines(Opts, Builder); @@ -4754,7 +4754,7 @@ return CPUKnown; } - virtual void getTargetDefines(const LangOptions &Opts, + void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { // Target identification. Builder.defineMacro("__aarch64__"); @@ -4814,7 +4814,7 @@ Builder.defineMacro("__ARM_FEATURE_CRYPTO"); } - virtual void getTargetBuiltins(const Builtin::Info *&Records, + void getTargetBuiltins(const Builtin::Info *&Records, unsigned &NumRecords) const override { Records = BuiltinInfo; NumRecords = clang::AArch64::LastTSBuiltin - Builtin::FirstTSBuiltin; @@ -4851,12 +4851,12 @@ return TargetInfo::AArch64ABIBuiltinVaList; } - virtual void getGCCRegNames(const char *const *&Names, + void getGCCRegNames(const char *const *&Names, unsigned &NumNames) const override; - virtual void getGCCRegAliases(const GCCRegAlias *&Aliases, + void getGCCRegAliases(const GCCRegAlias *&Aliases, unsigned &NumAliases) const override; - virtual bool + bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override { switch (*Name) { Index: lib/Basic/VirtualFileSystem.cpp =================================================================== --- lib/Basic/VirtualFileSystem.cpp +++ lib/Basic/VirtualFileSystem.cpp @@ -92,7 +92,7 @@ } public: - ~RealFile(); + ~RealFile() override; ErrorOr status() override; ErrorOr> getBuffer(const Twine &Name, int64_t FileSize = -1, @@ -362,7 +362,7 @@ Status S; public: - virtual ~DirectoryEntry(); + ~DirectoryEntry() override; DirectoryEntry(StringRef Name, std::vector Contents, Status S) : Entry(EK_Directory, Name), Contents(std::move(Contents)), S(std::move(S)) {} @@ -498,7 +498,7 @@ ErrorOr status(const Twine &Path, Entry *E); public: - ~VFSFromYAML(); + ~VFSFromYAML() override; /// \brief Parses \p Buffer, which is expected to be in YAML format and /// returns a virtual file system representing its contents. Index: lib/CodeGen/CGOpenMPRuntime.cpp =================================================================== --- lib/CodeGen/CGOpenMPRuntime.cpp +++ lib/CodeGen/CGOpenMPRuntime.cpp @@ -46,7 +46,7 @@ virtual LValue getThreadIDVariableLValue(CodeGenFunction &CGF); /// \brief Emit the captured statement body. - virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S) override; + void EmitBody(CodeGenFunction &CGF, const Stmt *S) override; static bool classof(const CGCapturedStmtInfo *Info) { return Info->getKind() == CR_OpenMP; @@ -66,7 +66,7 @@ } /// \brief Get a variable or parameter for storing global thread id /// inside OpenMP construct. - virtual const VarDecl *getThreadIDVariable() const override { + const VarDecl *getThreadIDVariable() const override { return ThreadIDVar; } /// \brief Get the name of the capture helper. @@ -91,15 +91,15 @@ } /// \brief Get a variable or parameter for storing global thread id /// inside OpenMP construct. - virtual const VarDecl *getThreadIDVariable() const override { + const VarDecl *getThreadIDVariable() const override { return ThreadIDVar; } /// \brief Get an LValue for the current ThreadID variable. - virtual LValue getThreadIDVariableLValue(CodeGenFunction &CGF) override; + LValue getThreadIDVariableLValue(CodeGenFunction &CGF) override; /// \brief Emit the captured statement body. - virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S) override; + void EmitBody(CodeGenFunction &CGF, const Stmt *S) override; /// \brief Get the name of the capture helper. StringRef getHelperName() const override { return ".omp_outlined."; } @@ -122,33 +122,33 @@ : CGOpenMPRegionInfo(D), OldCSI(OldCSI), OuterRegionInfo(dyn_cast_or_null(OldCSI)) {} // \brief Retrieve the value of the context parameter. - virtual llvm::Value *getContextValue() const override { + llvm::Value *getContextValue() const override { if (OuterRegionInfo) return OuterRegionInfo->getContextValue(); llvm_unreachable("No context value for inlined OpenMP region"); } /// \brief Lookup the captured field decl for a variable. - virtual const FieldDecl *lookup(const VarDecl *VD) const override { + const FieldDecl *lookup(const VarDecl *VD) const override { if (OuterRegionInfo) return OuterRegionInfo->lookup(VD); llvm_unreachable("Trying to reference VarDecl that is neither local nor " "captured in outer OpenMP region"); } - virtual FieldDecl *getThisFieldDecl() const override { + FieldDecl *getThisFieldDecl() const override { if (OuterRegionInfo) return OuterRegionInfo->getThisFieldDecl(); return nullptr; } /// \brief Get a variable or parameter for storing global thread id /// inside OpenMP construct. - virtual const VarDecl *getThreadIDVariable() const override { + const VarDecl *getThreadIDVariable() const override { if (OuterRegionInfo) return OuterRegionInfo->getThreadIDVariable(); return nullptr; } /// \brief Get the name of the capture helper. - virtual StringRef getHelperName() const override { + StringRef getHelperName() const override { llvm_unreachable("No helper name for inlined OpenMP construct"); } Index: lib/CodeGen/ModuleBuilder.cpp =================================================================== --- lib/CodeGen/ModuleBuilder.cpp +++ lib/CodeGen/ModuleBuilder.cpp @@ -63,7 +63,7 @@ CoverageInfo(CoverageInfo), M(new llvm::Module(ModuleName, C)) {} - virtual ~CodeGeneratorImpl() { + ~CodeGeneratorImpl() override { // There should normally not be any leftover inline method definitions. assert(DeferredInlineMethodDefinitions.empty() || Diags.hasErrorOccurred()); Index: lib/CodeGen/TargetInfo.cpp =================================================================== --- lib/CodeGen/TargetInfo.cpp +++ lib/CodeGen/TargetInfo.cpp @@ -1625,7 +1625,7 @@ : X86_64TargetCodeGenInfo(CGT, HasAVX) {} void getDependentLibraryOption(llvm::StringRef Lib, - llvm::SmallString<24> &Opt) const { + llvm::SmallString<24> &Opt) const override { Opt = "\01"; Opt += Lib; } @@ -3915,7 +3915,7 @@ llvm::Value *EmitAAPCSVAArg(llvm::Value *VAListAddr, QualType Ty, CodeGenFunction &CGF) const; - virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, + llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, CodeGenFunction &CGF) const override { return isDarwinPCS() ? EmitDarwinVAArg(VAListAddr, Ty, CGF) : EmitAAPCSVAArg(VAListAddr, Ty, CGF); @@ -3927,13 +3927,13 @@ AArch64TargetCodeGenInfo(CodeGenTypes &CGT, AArch64ABIInfo::ABIKind Kind) : TargetCodeGenInfo(new AArch64ABIInfo(CGT, Kind)) {} - StringRef getARCRetainAutoreleasedReturnValueMarker() const { + StringRef getARCRetainAutoreleasedReturnValueMarker() const override { return "mov\tfp, fp\t\t; marker for objc_retainAutoreleaseReturnValue"; } - int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const { return 31; } + int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const override { return 31; } - virtual bool doesReturnSlotInterfereWithArgs() const { return false; } + bool doesReturnSlotInterfereWithArgs() const override { return false; } }; } Index: lib/Driver/ToolChains.h =================================================================== --- lib/Driver/ToolChains.h +++ lib/Driver/ToolChains.h @@ -152,7 +152,7 @@ public: Generic_GCC(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); - ~Generic_GCC(); + ~Generic_GCC() override; void printVerboseInfo(raw_ostream &OS) const override; @@ -196,7 +196,7 @@ public: MachO(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); - ~MachO(); + ~MachO() override; /// @name MachO specific toolchain API /// { @@ -345,7 +345,7 @@ public: Darwin(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); - ~Darwin(); + ~Darwin() override; std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args, types::ID InputType) const override; @@ -487,7 +487,7 @@ AddCCKextLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const override; - virtual void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) + void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const override; void @@ -699,7 +699,7 @@ public: Hexagon_TC(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); - ~Hexagon_TC(); + ~Hexagon_TC() override; void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, @@ -762,7 +762,7 @@ public: TCEToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); - ~TCEToolChain(); + ~TCEToolChain() override; bool IsMathErrnoDefault() const override; bool isPICDefault() const override; Index: lib/Format/UnwrappedLineParser.cpp =================================================================== --- lib/Format/UnwrappedLineParser.cpp +++ lib/Format/UnwrappedLineParser.cpp @@ -68,7 +68,7 @@ Line.InPPDirective = true; } - ~ScopedMacroState() { + ~ScopedMacroState() override { TokenSource = PreviousTokenSource; ResetToken = Token; Line.InPPDirective = false; Index: lib/Frontend/CacheTokens.cpp =================================================================== --- lib/Frontend/CacheTokens.cpp +++ lib/Frontend/CacheTokens.cpp @@ -537,7 +537,7 @@ PTHMap &PM; public: StatListener(PTHMap &pm) : PM(pm) {} - ~StatListener() {} + ~StatListener() override {} LookupResult getStat(const char *Path, FileData &Data, bool isFile, std::unique_ptr *F, Index: lib/Frontend/ChainedIncludesSource.cpp =================================================================== --- lib/Frontend/ChainedIncludesSource.cpp +++ lib/Frontend/ChainedIncludesSource.cpp @@ -27,7 +27,7 @@ namespace { class ChainedIncludesSource : public ExternalSemaSource { public: - virtual ~ChainedIncludesSource(); + ~ChainedIncludesSource() override; ExternalSemaSource &getFinalReader() const { return *FinalReader; } Index: lib/Frontend/FrontendAction.cpp =================================================================== --- lib/Frontend/FrontendAction.cpp +++ lib/Frontend/FrontendAction.cpp @@ -44,7 +44,7 @@ explicit DelegatingDeserializationListener( ASTDeserializationListener *Previous, bool DeletePrevious) : Previous(Previous), DeletePrevious(DeletePrevious) {} - virtual ~DelegatingDeserializationListener() { + ~DelegatingDeserializationListener() override { if (DeletePrevious) delete Previous; } Index: lib/Frontend/FrontendActions.cpp =================================================================== --- lib/Frontend/FrontendActions.cpp +++ lib/Frontend/FrontendActions.cpp @@ -480,7 +480,7 @@ return false; } - virtual bool + bool ReadDiagnosticOptions(IntrusiveRefCntPtr DiagOpts, bool Complain) override { Out.indent(2) << "Diagnostic options:\n"; Index: lib/Frontend/HeaderIncludeGen.cpp =================================================================== --- lib/Frontend/HeaderIncludeGen.cpp +++ lib/Frontend/HeaderIncludeGen.cpp @@ -35,7 +35,7 @@ OwnsOutputFile(OwnsOutputFile_), ShowAllHeaders(ShowAllHeaders_), ShowDepth(ShowDepth_), MSStyle(MSStyle_) {} - ~HeaderIncludesCallback() { + ~HeaderIncludesCallback() override { if (OwnsOutputFile) delete OutputFile; } Index: lib/Frontend/Rewrite/RewriteModernObjC.cpp =================================================================== --- lib/Frontend/Rewrite/RewriteModernObjC.cpp +++ lib/Frontend/Rewrite/RewriteModernObjC.cpp @@ -244,7 +244,7 @@ DiagnosticsEngine &D, const LangOptions &LOpts, bool silenceMacroWarn, bool LineInfo); - ~RewriteModernObjC() {} + ~RewriteModernObjC() override {} void HandleTranslationUnit(ASTContext &C) override; Index: lib/Frontend/Rewrite/RewriteObjC.cpp =================================================================== --- lib/Frontend/Rewrite/RewriteObjC.cpp +++ lib/Frontend/Rewrite/RewriteObjC.cpp @@ -193,7 +193,7 @@ DiagnosticsEngine &D, const LangOptions &LOpts, bool silenceMacroWarn); - ~RewriteObjC() {} + ~RewriteObjC() override {} void HandleTranslationUnit(ASTContext &C) override; @@ -512,7 +512,7 @@ D, LOpts, silenceMacroWarn) {} - ~RewriteObjCFragileABI() {} + ~RewriteObjCFragileABI() override {} void Initialize(ASTContext &context) override; // Rewriting metadata Index: lib/Frontend/SerializedDiagnosticPrinter.cpp =================================================================== --- lib/Frontend/SerializedDiagnosticPrinter.cpp +++ lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -61,7 +61,7 @@ DiagnosticOptions *DiagOpts) : DiagnosticNoteRenderer(LangOpts, DiagOpts), Writer(Writer) {} - virtual ~SDiagsRenderer() {} + ~SDiagsRenderer() override {} protected: void emitDiagnosticMessage(SourceLocation Loc, @@ -158,7 +158,7 @@ EmitPreamble(); } - ~SDiagsWriter() {} + ~SDiagsWriter() override {} void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override; Index: lib/Frontend/VerifyDiagnosticConsumer.cpp =================================================================== --- lib/Frontend/VerifyDiagnosticConsumer.cpp +++ lib/Frontend/VerifyDiagnosticConsumer.cpp @@ -58,9 +58,9 @@ /// \brief Hook into the preprocessor and update the list of parsed /// files when the preprocessor indicates a new file is entered. - virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason, + void FileChanged(SourceLocation Loc, FileChangeReason Reason, SrcMgr::CharacteristicKind FileType, - FileID PrevFID) { + FileID PrevFID) override { Verify.UpdateParsedFileStatus(SM, SM.getFileID(Loc), VerifyDiagnosticConsumer::IsParsed); } Index: lib/Sema/AnalysisBasedWarnings.cpp =================================================================== --- lib/Sema/AnalysisBasedWarnings.cpp +++ lib/Sema/AnalysisBasedWarnings.cpp @@ -139,7 +139,7 @@ return false; } - void compareAlwaysTrue(const BinaryOperator *B, bool isAlwaysTrue) { + void compareAlwaysTrue(const BinaryOperator *B, bool isAlwaysTrue) override { if (HasMacroID(B)) return; @@ -148,7 +148,7 @@ << DiagRange << isAlwaysTrue; } - void compareBitwiseEquality(const BinaryOperator *B, bool isAlwaysTrue) { + void compareBitwiseEquality(const BinaryOperator *B, bool isAlwaysTrue) override { if (HasMacroID(B)) return; @@ -1333,7 +1333,7 @@ public: UninitValsDiagReporter(Sema &S) : S(S), uses(nullptr) {} - ~UninitValsDiagReporter() { + ~UninitValsDiagReporter() override { flushDiagnostics(); } @@ -1664,7 +1664,7 @@ } - virtual void handleNegativeNotHeld(StringRef Kind, Name LockName, Name Neg, + void handleNegativeNotHeld(StringRef Kind, Name LockName, Name Neg, SourceLocation Loc) override { PartialDiagnosticAt Warning(Loc, S.PDiag(diag::warn_acquire_requires_negative_cap) @@ -1681,7 +1681,7 @@ } - virtual void handleLockAcquiredBefore(StringRef Kind, Name L1Name, + void handleLockAcquiredBefore(StringRef Kind, Name L1Name, Name L2Name, SourceLocation Loc) override { PartialDiagnosticAt Warning(Loc, @@ -1689,7 +1689,7 @@ Warnings.push_back(DelayedDiag(Warning, getNotes())); } - virtual void handleBeforeAfterCycle(Name L1Name, SourceLocation Loc) + void handleBeforeAfterCycle(Name L1Name, SourceLocation Loc) override { PartialDiagnosticAt Warning(Loc, S.PDiag(diag::warn_acquired_before_after_cycle) << L1Name); Index: lib/Sema/SemaExprCXX.cpp =================================================================== --- lib/Sema/SemaExprCXX.cpp +++ lib/Sema/SemaExprCXX.cpp @@ -1418,7 +1418,7 @@ << ConvTy->isEnumeralType() << ConvTy; } - virtual SemaDiagnosticBuilder diagnoseConversion( + SemaDiagnosticBuilder diagnoseConversion( Sema &S, SourceLocation Loc, QualType T, QualType ConvTy) override { return S.Diag(Loc, S.getLangOpts().CPlusPlus11 Index: lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp +++ lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp @@ -142,7 +142,7 @@ : cfg(cfg), Ctx(ctx), BR(br), Checker(checker), AC(ac), Parents(parents), Escaped(escaped), currentBlock(nullptr) {} - virtual ~DeadStoreObs() {} + ~DeadStoreObs() override {} bool isLive(const LiveVariables::LivenessValues &Live, const VarDecl *D) { if (Live.isLive(D)) Index: lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp +++ lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp @@ -137,7 +137,7 @@ public: SecKeychainBugVisitor(SymbolRef S) : Sym(S) {} - virtual ~SecKeychainBugVisitor() {} + ~SecKeychainBugVisitor() override {} void Profile(llvm::FoldingSetNodeID &ID) const override { static int X = 0; Index: lib/StaticAnalyzer/Checkers/MallocChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -393,7 +393,7 @@ MallocBugVisitor(SymbolRef S, bool isLeak = false) : Sym(S), Mode(Normal), FailedReallocSymbol(nullptr), IsLeak(isLeak) {} - virtual ~MallocBugVisitor() {} + ~MallocBugVisitor() override {} void Profile(llvm::FoldingSetNodeID &ID) const override { static int X = 0; Index: lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -2475,7 +2475,7 @@ : ShouldResetSummaryLog(false), IncludeAllocationLine(shouldIncludeAllocationSiteInLeakDiagnostics(AO)) {} - virtual ~RetainCountChecker() { + ~RetainCountChecker() override { DeleteContainerSeconds(DeadSymbolTags); } Index: lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp =================================================================== --- lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp +++ lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp @@ -45,7 +45,7 @@ public: HTMLDiagnostics(AnalyzerOptions &AnalyzerOpts, const std::string& prefix, const Preprocessor &pp); - virtual ~HTMLDiagnostics() { FlushDiagnostics(nullptr); } + ~HTMLDiagnostics() override { FlushDiagnostics(nullptr); } void FlushDiagnosticsImpl(std::vector &Diags, FilesMade *filesMade) override; Index: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp =================================================================== --- lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -37,7 +37,7 @@ const LangOptions &LangOpts, bool supportsMultipleFiles); - virtual ~PlistDiagnostics() {} + ~PlistDiagnostics() override {} void FlushDiagnosticsImpl(std::vector &Diags, FilesMade *filesMade) override; Index: lib/StaticAnalyzer/Core/SimpleConstraintManager.h =================================================================== --- lib/StaticAnalyzer/Core/SimpleConstraintManager.h +++ lib/StaticAnalyzer/Core/SimpleConstraintManager.h @@ -27,7 +27,7 @@ public: SimpleConstraintManager(SubEngine *subengine, SValBuilder &SB) : SU(subengine), SVB(SB) {} - virtual ~SimpleConstraintManager(); + ~SimpleConstraintManager() override; //===------------------------------------------------------------------===// // Common implementation for the interface provided by ConstraintManager. Index: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp =================================================================== --- lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp +++ lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp @@ -29,7 +29,7 @@ SimpleSValBuilder(llvm::BumpPtrAllocator &alloc, ASTContext &context, ProgramStateManager &stateMgr) : SValBuilder(alloc, context, stateMgr) {} - virtual ~SimpleSValBuilder() {} + ~SimpleSValBuilder() override {} SVal evalMinus(NonLoc val) override; SVal evalComplement(NonLoc val) override; Index: lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp =================================================================== --- lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -92,7 +92,7 @@ public: ClangDiagPathDiagConsumer(DiagnosticsEngine &Diag) : Diag(Diag), IncludePath(false) {} - virtual ~ClangDiagPathDiagConsumer() {} + ~ClangDiagPathDiagConsumer() override {} StringRef getName() const override { return "ClangDiags"; } bool supportsLogicalOpControlFlow() const override { return true; } @@ -199,7 +199,7 @@ } } - ~AnalysisConsumer() { + ~AnalysisConsumer() override { if (Opts->PrintStats) delete TUTotalTimer; } @@ -373,7 +373,7 @@ return true; } - virtual void + void AddDiagnosticConsumer(PathDiagnosticConsumer *Consumer) override { PathConsumers.push_back(Consumer); } @@ -724,7 +724,7 @@ public: UbigraphViz(std::unique_ptr Out, StringRef Filename); - ~UbigraphViz(); + ~UbigraphViz() override; void AddEdge(ExplodedNode *Src, ExplodedNode *Dst) override; }; Index: lib/StaticAnalyzer/Frontend/ModelInjector.h =================================================================== --- lib/StaticAnalyzer/Frontend/ModelInjector.h +++ lib/StaticAnalyzer/Frontend/ModelInjector.h @@ -43,8 +43,8 @@ class ModelInjector : public CodeInjector { public: ModelInjector(CompilerInstance &CI); - Stmt *getBody(const FunctionDecl *D); - Stmt *getBody(const ObjCMethodDecl *D); + Stmt *getBody(const FunctionDecl *D) override; + Stmt *getBody(const ObjCMethodDecl *D) override; private: /// \brief Synthesize a body for a declaration Index: lib/Tooling/CompilationDatabase.cpp =================================================================== --- lib/Tooling/CompilationDatabase.cpp +++ lib/Tooling/CompilationDatabase.cpp @@ -156,7 +156,7 @@ // recording for our own purposes. UnusedInputDiagConsumer(DiagnosticConsumer *Other) : Other(Other) {} - virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, + void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override { if (Info.getID() == clang::diag::warn_drv_input_file_unused) { // Arg 1 for this diagnostic is the option that didn't get used. Index: tools/libclang/CIndexCodeCompletion.cpp =================================================================== --- tools/libclang/CIndexCodeCompletion.cpp +++ tools/libclang/CIndexCodeCompletion.cpp @@ -533,7 +533,7 @@ : CodeCompleteConsumer(Opts, false), AllocatedResults(Results), CCTUInfo(Results.CodeCompletionAllocator), TU(TranslationUnit) { } - ~CaptureCompletionResults() { Finish(); } + ~CaptureCompletionResults() override { Finish(); } void ProcessCodeCompleteResults(Sema &S, CodeCompletionContext Context, Index: tools/libclang/CIndexDiagnostic.h =================================================================== --- tools/libclang/CIndexDiagnostic.h +++ tools/libclang/CIndexDiagnostic.h @@ -117,7 +117,7 @@ : CXDiagnosticImpl(StoredDiagnosticKind), Diag(Diag), LangOpts(LangOpts) { } - virtual ~CXStoredDiagnostic() {} + ~CXStoredDiagnostic() override {} /// \brief Return the severity of the diagnostic. CXDiagnosticSeverity getSeverity() const override; Index: tools/libclang/CIndexDiagnostic.cpp =================================================================== --- tools/libclang/CIndexDiagnostic.cpp +++ tools/libclang/CIndexDiagnostic.cpp @@ -48,7 +48,7 @@ : CXDiagnosticImpl(CustomNoteDiagnosticKind), Message(Msg), Loc(L) {} - virtual ~CXDiagnosticCustomNoteImpl() {} + ~CXDiagnosticCustomNoteImpl() override {} CXDiagnosticSeverity getSeverity() const override { return CXDiagnostic_Note; @@ -92,7 +92,7 @@ : DiagnosticNoteRenderer(LangOpts, DiagOpts), CurrentSet(mainSet), MainSet(mainSet) {} - virtual ~CXDiagnosticRenderer() {} + ~CXDiagnosticRenderer() override {} void beginDiagnostic(DiagOrStoredDiag D, DiagnosticsEngine::Level Level) override { Index: tools/libclang/CXLoadedDiagnostic.h =================================================================== --- tools/libclang/CXLoadedDiagnostic.h +++ tools/libclang/CXLoadedDiagnostic.h @@ -26,7 +26,7 @@ CXLoadedDiagnostic() : CXDiagnosticImpl(LoadedDiagnosticKind), severity(0), category(0) {} - virtual ~CXLoadedDiagnostic(); + ~CXLoadedDiagnostic() override; /// \brief Return the severity of the diagnostic. CXDiagnosticSeverity getSeverity() const override; Index: tools/libclang/CXLoadedDiagnostic.cpp =================================================================== --- tools/libclang/CXLoadedDiagnostic.cpp +++ tools/libclang/CXLoadedDiagnostic.cpp @@ -37,7 +37,7 @@ class CXLoadedDiagnosticSetImpl : public CXDiagnosticSetImpl { public: CXLoadedDiagnosticSetImpl() : CXDiagnosticSetImpl(true), FakeFiles(FO) {} - virtual ~CXLoadedDiagnosticSetImpl() {} + ~CXLoadedDiagnosticSetImpl() override {} llvm::BumpPtrAllocator Alloc; Strings Categories; Index: unittests/AST/DeclPrinterTest.cpp =================================================================== --- unittests/AST/DeclPrinterTest.cpp +++ unittests/AST/DeclPrinterTest.cpp @@ -44,7 +44,7 @@ public: PrintMatch() : NumFoundDecls(0) {} - virtual void run(const MatchFinder::MatchResult &Result) { + void run(const MatchFinder::MatchResult &Result) override { const Decl *D = Result.Nodes.getDeclAs("id"); if (!D || D->isImplicit()) return; Index: unittests/AST/ExternalASTSourceTest.cpp =================================================================== --- unittests/AST/ExternalASTSourceTest.cpp +++ unittests/AST/ExternalASTSourceTest.cpp @@ -28,15 +28,15 @@ TestFrontendAction(ExternalASTSource *Source) : Source(Source) {} private: - virtual void ExecuteAction() { + void ExecuteAction() override { getCompilerInstance().getASTContext().setExternalSource(Source); getCompilerInstance().getASTContext().getTranslationUnitDecl() ->setHasExternalVisibleStorage(); return ASTFrontendAction::ExecuteAction(); } - virtual std::unique_ptr CreateASTConsumer(CompilerInstance &CI, - StringRef InFile) { + std::unique_ptr CreateASTConsumer(CompilerInstance &CI, + StringRef InFile) override { return llvm::make_unique(); } @@ -68,7 +68,7 @@ TestSource(unsigned &Calls) : Calls(Calls) {} bool FindExternalVisibleDeclsByName(const DeclContext*, - DeclarationName Name) { + DeclarationName Name) override { if (Name.getAsString() == "j") ++Calls; return false; Index: unittests/AST/MatchVerifier.h =================================================================== --- unittests/AST/MatchVerifier.h +++ unittests/AST/MatchVerifier.h @@ -63,7 +63,7 @@ Language L); protected: - virtual void run(const MatchFinder::MatchResult &Result); + void run(const MatchFinder::MatchResult &Result) override; virtual void verify(const MatchFinder::MatchResult &Result, const NodeType &Node) {} @@ -166,7 +166,7 @@ } protected: - void verify(const MatchFinder::MatchResult &Result, const NodeType &Node) { + void verify(const MatchFinder::MatchResult &Result, const NodeType &Node) override { SourceLocation Loc = getLocation(Node); unsigned Line = Result.SourceManager->getSpellingLineNumber(Loc); unsigned Column = Result.SourceManager->getSpellingColumnNumber(Loc); @@ -205,7 +205,7 @@ } protected: - void verify(const MatchFinder::MatchResult &Result, const NodeType &Node) { + void verify(const MatchFinder::MatchResult &Result, const NodeType &Node) override { SourceRange R = getRange(Node); SourceLocation Begin = R.getBegin(); SourceLocation End = R.getEnd(); @@ -244,7 +244,7 @@ protected: void verify(const MatchFinder::MatchResult &Result, - const ast_type_traits::DynTypedNode &Node) { + const ast_type_traits::DynTypedNode &Node) override { std::string DumpStr; llvm::raw_string_ostream Dump(DumpStr); Node.dump(Dump, *Result.SourceManager); @@ -271,7 +271,7 @@ protected: void verify(const MatchFinder::MatchResult &Result, - const ast_type_traits::DynTypedNode &Node) { + const ast_type_traits::DynTypedNode &Node) override { std::string PrintStr; llvm::raw_string_ostream Print(PrintStr); Node.print(Print, Result.Context->getPrintingPolicy()); Index: unittests/AST/NamedDeclPrinterTest.cpp =================================================================== --- unittests/AST/NamedDeclPrinterTest.cpp +++ unittests/AST/NamedDeclPrinterTest.cpp @@ -37,7 +37,7 @@ explicit PrintMatch(bool suppressUnwrittenScope) : NumFoundDecls(0), SuppressUnwrittenScope(suppressUnwrittenScope) {} - virtual void run(const MatchFinder::MatchResult &Result) { + void run(const MatchFinder::MatchResult &Result) override { const NamedDecl *ND = Result.Nodes.getNodeAs("id"); if (!ND) return; Index: unittests/AST/SourceLocationTest.cpp =================================================================== --- unittests/AST/SourceLocationTest.cpp +++ unittests/AST/SourceLocationTest.cpp @@ -60,7 +60,7 @@ class LabelDeclRangeVerifier : public RangeVerifier { protected: - virtual SourceRange getRange(const LabelStmt &Node) { + SourceRange getRange(const LabelStmt &Node) override { return Node.getDecl()->getSourceRange(); } }; @@ -111,7 +111,7 @@ class MemberExprArrowLocVerifier : public RangeVerifier { protected: - virtual SourceRange getRange(const MemberExpr &Node) { + SourceRange getRange(const MemberExpr &Node) override { return Node.getOperatorLoc(); } }; @@ -201,7 +201,7 @@ class TemplateAngleBracketLocRangeVerifier : public RangeVerifier { protected: - virtual SourceRange getRange(const TypeLoc &Node) { + SourceRange getRange(const TypeLoc &Node) override { TemplateSpecializationTypeLoc T = Node.getUnqualifiedLoc().castAs(); assert(!T.isNull()); @@ -226,7 +226,7 @@ class UnaryTransformTypeLocParensRangeVerifier : public RangeVerifier { protected: - virtual SourceRange getRange(const TypeLoc &Node) { + SourceRange getRange(const TypeLoc &Node) override { UnaryTransformTypeLoc T = Node.getUnqualifiedLoc().castAs(); assert(!T.isNull()); Index: unittests/AST/StmtPrinterTest.cpp =================================================================== --- unittests/AST/StmtPrinterTest.cpp +++ unittests/AST/StmtPrinterTest.cpp @@ -44,7 +44,7 @@ public: PrintMatch() : NumFoundStmts(0) {} - virtual void run(const MatchFinder::MatchResult &Result) { + void run(const MatchFinder::MatchResult &Result) override { const Stmt *S = Result.Nodes.getStmtAs("id"); if (!S) return; Index: unittests/ASTMatchers/ASTMatchersTest.cpp =================================================================== --- unittests/ASTMatchers/ASTMatchersTest.cpp +++ unittests/ASTMatchers/ASTMatchersTest.cpp @@ -747,12 +747,12 @@ Name.clear(); } - ~VerifyIdIsBoundTo() { + ~VerifyIdIsBoundTo() override { EXPECT_EQ(0, Count); EXPECT_EQ("", Name); } - virtual bool run(const BoundNodes *Nodes) override { + bool run(const BoundNodes *Nodes) override { const BoundNodes::IDToNodeMap &M = Nodes->getMap(); if (Nodes->getNodeAs(Id)) { ++Count; @@ -774,7 +774,7 @@ return false; } - virtual bool run(const BoundNodes *Nodes, ASTContext *Context) override { + bool run(const BoundNodes *Nodes, ASTContext *Context) override { return run(Nodes); } @@ -4379,9 +4379,9 @@ : Id(Id), InnerMatcher(InnerMatcher), InnerId(InnerId) { } - virtual bool run(const BoundNodes *Nodes) { return false; } + bool run(const BoundNodes *Nodes) override { return false; } - virtual bool run(const BoundNodes *Nodes, ASTContext *Context) { + bool run(const BoundNodes *Nodes, ASTContext *Context) override { const T *Node = Nodes->getNodeAs(Id); return selectFirst(InnerId, match(InnerMatcher, *Node, *Context)) != nullptr; @@ -4430,9 +4430,9 @@ template class VerifyAncestorHasChildIsEqual : public BoundNodesCallback { public: - virtual bool run(const BoundNodes *Nodes) { return false; } + bool run(const BoundNodes *Nodes) override { return false; } - virtual bool run(const BoundNodes *Nodes, ASTContext *Context) { + bool run(const BoundNodes *Nodes, ASTContext *Context) override { const T *Node = Nodes->getNodeAs(""); return verify(*Nodes, *Context, Node); } @@ -4488,10 +4488,10 @@ class VerifyStartOfTranslationUnit : public MatchFinder::MatchCallback { public: VerifyStartOfTranslationUnit() : Called(false) {} - virtual void run(const MatchFinder::MatchResult &Result) { + void run(const MatchFinder::MatchResult &Result) override { EXPECT_TRUE(Called); } - virtual void onStartOfTranslationUnit() { + void onStartOfTranslationUnit() override { Called = true; } bool Called; @@ -4516,10 +4516,10 @@ class VerifyEndOfTranslationUnit : public MatchFinder::MatchCallback { public: VerifyEndOfTranslationUnit() : Called(false) {} - virtual void run(const MatchFinder::MatchResult &Result) { + void run(const MatchFinder::MatchResult &Result) override { EXPECT_FALSE(Called); } - virtual void onEndOfTranslationUnit() { + void onEndOfTranslationUnit() override { Called = true; } bool Called; Index: unittests/ASTMatchers/Dynamic/ParserTest.cpp =================================================================== --- unittests/ASTMatchers/Dynamic/ParserTest.cpp +++ unittests/ASTMatchers/Dynamic/ParserTest.cpp @@ -23,7 +23,7 @@ class MockSema : public Parser::Sema { public: - virtual ~MockSema() {} + ~MockSema() override {} uint64_t expectMatcher(StringRef MatcherName) { // Optimizations on the matcher framework make simple matchers like @@ -42,7 +42,7 @@ Errors.push_back(Error.toStringFull()); } - llvm::Optional lookupMatcherCtor(StringRef MatcherName) { + llvm::Optional lookupMatcherCtor(StringRef MatcherName) override { const ExpectedMatchersTy::value_type *Matcher = &*ExpectedMatchers.find(MatcherName); return reinterpret_cast(Matcher); @@ -52,7 +52,7 @@ const SourceRange &NameRange, StringRef BindID, ArrayRef Args, - Diagnostics *Error) { + Diagnostics *Error) override { const ExpectedMatchersTy::value_type *Matcher = reinterpret_cast(Ctor); MatcherInfo ToStore = { Matcher->first, NameRange, Args, BindID }; Index: unittests/Basic/SourceManagerTest.cpp =================================================================== --- unittests/Basic/SourceManagerTest.cpp +++ unittests/Basic/SourceManagerTest.cpp @@ -258,14 +258,14 @@ public: explicit MacroTracker(std::vector &Macros) : Macros(Macros) { } - virtual void MacroDefined(const Token &MacroNameTok, - const MacroDirective *MD) { + void MacroDefined(const Token &MacroNameTok, + const MacroDirective *MD) override { Macros.push_back(MacroAction(MD->getLocation(), MacroNameTok.getIdentifierInfo()->getName(), true)); } - virtual void MacroExpands(const Token &MacroNameTok, const MacroDirective *MD, - SourceRange Range, const MacroArgs *Args) { + void MacroExpands(const Token &MacroNameTok, const MacroDirective *MD, + SourceRange Range, const MacroArgs *Args) override { Macros.push_back(MacroAction(MacroNameTok.getLocation(), MacroNameTok.getIdentifierInfo()->getName(), false)); Index: unittests/Basic/VirtualFileSystemTest.cpp =================================================================== --- unittests/Basic/VirtualFileSystemTest.cpp +++ unittests/Basic/VirtualFileSystemTest.cpp @@ -521,7 +521,7 @@ public: int NumDiagnostics; - void SetUp() { + void SetUp() override { NumDiagnostics = 0; } Index: unittests/Frontend/FrontendActionTest.cpp =================================================================== --- unittests/Frontend/FrontendActionTest.cpp +++ unittests/Frontend/FrontendActionTest.cpp @@ -35,15 +35,15 @@ bool ActOnEndOfTranslationUnit; std::vector decl_names; - virtual bool BeginSourceFileAction(CompilerInstance &ci, StringRef filename) { + bool BeginSourceFileAction(CompilerInstance &ci, StringRef filename) override { if (EnableIncrementalProcessing) ci.getPreprocessor().enableIncrementalProcessing(); return ASTFrontendAction::BeginSourceFileAction(ci, filename); } - virtual std::unique_ptr CreateASTConsumer(CompilerInstance &CI, - StringRef InFile) { + std::unique_ptr CreateASTConsumer(CompilerInstance &CI, + StringRef InFile) override { return llvm::make_unique(CI, ActOnEndOfTranslationUnit, decl_names); } @@ -56,7 +56,7 @@ CI(CI), ActOnEndOfTranslationUnit(ActOnEndOfTranslationUnit), decl_names_(decl_names) {} - virtual void HandleTranslationUnit(ASTContext &context) { + void HandleTranslationUnit(ASTContext &context) override { if (ActOnEndOfTranslationUnit) { CI.getSema().ActOnEndOfTranslationUnit(); } Index: unittests/Lex/PPCallbacksTest.cpp =================================================================== --- unittests/Lex/PPCallbacksTest.cpp +++ unittests/Lex/PPCallbacksTest.cpp @@ -62,7 +62,7 @@ const FileEntry *File, StringRef SearchPath, StringRef RelativePath, - const Module *Imported) { + const Module *Imported) override { this->HashLoc = HashLoc; this->IncludeTok = IncludeTok; this->FileName = FileName.str(); @@ -97,7 +97,7 @@ void PragmaOpenCLExtension( clang::SourceLocation NameLoc, const clang::IdentifierInfo *Name, - clang::SourceLocation StateLoc, unsigned State) { + clang::SourceLocation StateLoc, unsigned State) override { this->NameLoc = NameLoc; this->Name = Name->getName(); this->StateLoc = StateLoc; Index: unittests/Sema/ExternalSemaSourceTest.cpp =================================================================== --- unittests/Sema/ExternalSemaSourceTest.cpp +++ 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,16 @@ 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, + TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, int LookupKind, Scope *S, CXXScopeSpec *SS, CorrectionCandidateCallback &CCC, DeclContext *MemberContext, bool EnteringContext, - const ObjCObjectPointerType *OPT) { + const ObjCObjectPointerType *OPT) override { ++CallCount; if (CurrentSema && Typo.getName().getAsString() == CorrectFrom) { DeclContext *DestContext = nullptr; @@ -140,13 +140,13 @@ std::unique_ptr OwnedClient; protected: - virtual std::unique_ptr + std::unique_ptr CreateASTConsumer(clang::CompilerInstance &Compiler, - llvm::StringRef /* dummy */) { + llvm::StringRef /* dummy */) override { return llvm::make_unique(); } - virtual void ExecuteAction() { + void ExecuteAction() override { CompilerInstance &CI = getCompilerInstance(); ASSERT_FALSE(CI.hasSema()); CI.createSema(getTranslationUnitKind(), nullptr); Index: unittests/Tooling/CommentHandlerTest.cpp =================================================================== --- unittests/Tooling/CommentHandlerTest.cpp +++ unittests/Tooling/CommentHandlerTest.cpp @@ -30,11 +30,11 @@ public: CommentHandlerVisitor() : base(), PP(nullptr), Verified(false) {} - ~CommentHandlerVisitor() { + ~CommentHandlerVisitor() override { EXPECT_TRUE(Verified) << "CommentVerifier not accessed"; } - virtual bool HandleComment(Preprocessor &PP, SourceRange Loc) { + bool HandleComment(Preprocessor &PP, SourceRange Loc) override { assert(&PP == this->PP && "Preprocessor changed!"); SourceLocation Start = Loc.getBegin(); @@ -56,7 +56,7 @@ CommentVerifier GetVerifier(); protected: - virtual ASTFrontendAction* CreateTestAction() { + ASTFrontendAction* CreateTestAction() override { return new CommentHandlerAction(this); } @@ -70,8 +70,8 @@ CommentHandlerAction(CommentHandlerVisitor *Visitor) : TestAction(Visitor) { } - virtual bool BeginSourceFileAction(CompilerInstance &CI, - StringRef FileName) { + bool BeginSourceFileAction(CompilerInstance &CI, + StringRef FileName) override { CommentHandlerVisitor *V = static_cast(this->Visitor); V->PP = &CI.getPreprocessor(); @@ -79,7 +79,7 @@ return true; } - virtual void EndSourceFileAction() { + void EndSourceFileAction() override { CommentHandlerVisitor *V = static_cast(this->Visitor); V->PP->removeCommentHandler(V); Index: unittests/Tooling/CompilationDatabaseTest.cpp =================================================================== --- unittests/Tooling/CompilationDatabaseTest.cpp +++ unittests/Tooling/CompilationDatabaseTest.cpp @@ -127,8 +127,8 @@ } struct FakeComparator : public PathComparator { - virtual ~FakeComparator() {} - virtual bool equivalent(StringRef FileA, StringRef FileB) const { + ~FakeComparator() override {} + bool equivalent(StringRef FileA, StringRef FileB) const override { return FileA.equals_lower(FileB); } }; Index: unittests/Tooling/RefactoringTest.cpp =================================================================== --- unittests/Tooling/RefactoringTest.cpp +++ unittests/Tooling/RefactoringTest.cpp @@ -213,7 +213,7 @@ public: FlushRewrittenFilesTest() {} - ~FlushRewrittenFilesTest() { + ~FlushRewrittenFilesTest() override { for (llvm::StringMap::iterator I = TemporaryFiles.begin(), E = TemporaryFiles.end(); I != E; ++I) { @@ -287,7 +287,7 @@ public: FindConsumer(TestVisitor *Visitor) : Visitor(Visitor) {} - virtual void HandleTranslationUnit(clang::ASTContext &Context) { + void HandleTranslationUnit(clang::ASTContext &Context) override { Visitor->TraverseDecl(Context.getTranslationUnitDecl()); } @@ -299,9 +299,9 @@ public: TestAction(TestVisitor *Visitor) : Visitor(Visitor) {} - virtual std::unique_ptr + std::unique_ptr CreateASTConsumer(clang::CompilerInstance &compiler, - llvm::StringRef dummy) { + llvm::StringRef dummy) override { Visitor->SM = &compiler.getSourceManager(); /// TestConsumer will be deleted by the framework calling us. return llvm::make_unique(Visitor); Index: unittests/Tooling/TestVisitor.h =================================================================== --- unittests/Tooling/TestVisitor.h +++ unittests/Tooling/TestVisitor.h @@ -82,7 +82,7 @@ public: FindConsumer(TestVisitor *Visitor) : Visitor(Visitor) {} - virtual void HandleTranslationUnit(clang::ASTContext &Context) { + void HandleTranslationUnit(clang::ASTContext &Context) override { Visitor->Context = &Context; Visitor->TraverseDecl(Context.getTranslationUnitDecl()); } @@ -95,8 +95,8 @@ public: TestAction(TestVisitor *Visitor) : Visitor(Visitor) {} - virtual std::unique_ptr - CreateASTConsumer(CompilerInstance &, llvm::StringRef dummy) { + std::unique_ptr + CreateASTConsumer(CompilerInstance &, llvm::StringRef dummy) override { /// TestConsumer will be deleted by the framework calling us. return llvm::make_unique(Visitor); } @@ -133,7 +133,7 @@ } /// \brief Checks that all expected matches have been found. - virtual ~ExpectedLocationVisitor() { + ~ExpectedLocationVisitor() override { for (typename std::vector::const_iterator It = ExpectedMatches.begin(), End = ExpectedMatches.end(); It != End; ++It) { Index: unittests/Tooling/ToolingTest.cpp =================================================================== --- unittests/Tooling/ToolingTest.cpp +++ unittests/Tooling/ToolingTest.cpp @@ -35,8 +35,8 @@ : TestConsumer(std::move(TestConsumer)) {} protected: - virtual std::unique_ptr - CreateASTConsumer(clang::CompilerInstance &compiler, StringRef dummy) { + std::unique_ptr + CreateASTConsumer(clang::CompilerInstance &compiler, StringRef dummy) override { /// TestConsumer will be deleted by the framework calling us. return std::move(TestConsumer); } @@ -49,7 +49,7 @@ public: explicit FindTopLevelDeclConsumer(bool *FoundTopLevelDecl) : FoundTopLevelDecl(FoundTopLevelDecl) {} - virtual bool HandleTopLevelDecl(clang::DeclGroupRef DeclGroup) { + bool HandleTopLevelDecl(clang::DeclGroupRef DeclGroup) override { *FoundTopLevelDecl = true; return true; } @@ -72,7 +72,7 @@ public: FindClassDeclXConsumer(bool *FoundClassDeclX) : FoundClassDeclX(FoundClassDeclX) {} - virtual bool HandleTopLevelDecl(clang::DeclGroupRef GroupRef) { + bool HandleTopLevelDecl(clang::DeclGroupRef GroupRef) override { if (CXXRecordDecl* Record = dyn_cast( *GroupRef.begin())) { if (Record->getName() == "X") { @@ -184,12 +184,12 @@ struct VerifyEndCallback : public SourceFileCallbacks { VerifyEndCallback() : BeginCalled(0), EndCalled(0), Matched(false) {} - virtual bool handleBeginSource(CompilerInstance &CI, + bool handleBeginSource(CompilerInstance &CI, StringRef Filename) override { ++BeginCalled; return true; } - virtual void handleEndSource() override { + void handleEndSource() override { ++EndCalled; } std::unique_ptr newASTConsumer() { @@ -225,15 +225,15 @@ struct SkipBodyConsumer : public clang::ASTConsumer { /// Skip the 'skipMe' function. - virtual bool shouldSkipFunctionBody(Decl *D) { + bool shouldSkipFunctionBody(Decl *D) override { FunctionDecl *F = dyn_cast(D); return F && F->getNameAsString() == "skipMe"; } }; struct SkipBodyAction : public clang::ASTFrontendAction { - virtual std::unique_ptr - CreateASTConsumer(CompilerInstance &Compiler, StringRef) { + std::unique_ptr + CreateASTConsumer(CompilerInstance &Compiler, StringRef) override { Compiler.getFrontendOpts().SkipFunctionBodies = true; return llvm::make_unique(); } @@ -312,8 +312,8 @@ struct TestDiagnosticConsumer : public DiagnosticConsumer { TestDiagnosticConsumer() : NumDiagnosticsSeen(0) {} - virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, - const Diagnostic &Info) { + void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, + const Diagnostic &Info) override { ++NumDiagnosticsSeen; } unsigned NumDiagnosticsSeen; Index: unittests/libclang/LibclangTest.cpp =================================================================== --- unittests/libclang/LibclangTest.cpp +++ unittests/libclang/LibclangTest.cpp @@ -357,7 +357,7 @@ CXTranslationUnit ClangTU; unsigned TUFlags; - void SetUp() { + void SetUp() override { llvm::SmallString<256> Dir; ASSERT_FALSE(llvm::sys::fs::createUniqueDirectory("libclang-test", Dir)); TestDir = Dir.str(); @@ -365,7 +365,7 @@ clang_defaultEditingTranslationUnitOptions(); Index = clang_createIndex(0, 0); } - void TearDown() { + void TearDown() override { clang_disposeTranslationUnit(ClangTU); clang_disposeIndex(Index); for (const std::string &Path : Files) Index: utils/TableGen/NeonEmitter.cpp =================================================================== --- utils/TableGen/NeonEmitter.cpp +++ utils/TableGen/NeonEmitter.cpp @@ -1563,10 +1563,10 @@ // See the documentation in arm_neon.td for a description of these operators. class LowHalf : public SetTheory::Operator { public: - virtual void anchor() {} - virtual ~LowHalf() {} - virtual void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts, - ArrayRef Loc) { + void anchor() override {} + ~LowHalf() override {} + void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts, + ArrayRef Loc) override { SetTheory::RecSet Elts2; ST.evaluate(Expr->arg_begin(), Expr->arg_end(), Elts2, Loc); Elts.insert(Elts2.begin(), Elts2.begin() + (Elts2.size() / 2)); @@ -1574,10 +1574,10 @@ }; class HighHalf : public SetTheory::Operator { public: - virtual void anchor() {} - virtual ~HighHalf() {} - virtual void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts, - ArrayRef Loc) { + void anchor() override {} + ~HighHalf() override {} + void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts, + ArrayRef Loc) override { SetTheory::RecSet Elts2; ST.evaluate(Expr->arg_begin(), Expr->arg_end(), Elts2, Loc); Elts.insert(Elts2.begin() + (Elts2.size() / 2), Elts2.end()); @@ -1588,10 +1588,10 @@ public: Rev(unsigned ElementSize) : ElementSize(ElementSize) {} - virtual void anchor() {} - virtual ~Rev() {} - virtual void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts, - ArrayRef Loc) { + void anchor() override {} + ~Rev() override {} + void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts, + ArrayRef Loc) override { SetTheory::RecSet Elts2; ST.evaluate(Expr->arg_begin() + 1, Expr->arg_end(), Elts2, Loc); @@ -1613,9 +1613,9 @@ public: MaskExpander(unsigned N) : N(N) {} - virtual void anchor() {} - virtual ~MaskExpander() {} - virtual void expand(SetTheory &ST, Record *R, SetTheory::RecSet &Elts) { + void anchor() override {} + ~MaskExpander() override {} + void expand(SetTheory &ST, Record *R, SetTheory::RecSet &Elts) override { unsigned Addend = 0; if (R->getName() == "mask0") Addend = 0;