From 260dbc31432fd56e5f025c4a8bb363377ee1808a Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 11 Mar 2014 06:50:42 +0000 Subject: [C++11] Add 'override' keyword to virtual methods that override their base class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203547 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Lex/Lexer.h | 8 +- include/clang/Lex/PPCallbacks.h | 111 +++++++++++------------ include/clang/Lex/PPConditionalDirectiveRecord.h | 20 ++-- include/clang/Lex/PTHLexer.h | 4 +- include/clang/Lex/PTHManager.h | 2 +- include/clang/Lex/Pragma.h | 10 +- include/clang/Lex/PreprocessingRecord.h | 37 ++++---- lib/Lex/PTHLexer.cpp | 2 +- lib/Lex/Pragma.cpp | 68 +++++++------- 9 files changed, 126 insertions(+), 136 deletions(-) diff --git a/include/clang/Lex/Lexer.h b/include/clang/Lex/Lexer.h index af6d8cf750..513eb88e4a 100644 --- a/include/clang/Lex/Lexer.h +++ b/include/clang/Lex/Lexer.h @@ -44,7 +44,7 @@ enum ConflictMarkerKind { /// or buffering/seeking of tokens, only forward lexing is supported. It relies /// on the specified Preprocessor object to handle preprocessor directives, etc. class Lexer : public PreprocessorLexer { - virtual void anchor(); + void anchor() override; //===--------------------------------------------------------------------===// // Constant configuration values for this lexer. @@ -145,7 +145,7 @@ public: private: /// IndirectLex - An indirect call to 'Lex' that can be invoked via /// the PreprocessorLexer interface. - void IndirectLex(Token &Result) { Lex(Result); } + void IndirectLex(Token &Result) override { Lex(Result); } public: /// LexFromRawLexer - Lex a token from a designated raw lexer (one with no @@ -218,7 +218,9 @@ public: /// getSourceLocation - Return a source location for the next character in /// the current file. - SourceLocation getSourceLocation() { return getSourceLocation(BufferPtr); } + SourceLocation getSourceLocation() override { + return getSourceLocation(BufferPtr); + } /// \brief Return the current location in the buffer. const char *getBufferLocation() const { return BufferPtr; } diff --git a/include/clang/Lex/PPCallbacks.h b/include/clang/Lex/PPCallbacks.h index f1ed897251..974ab55f77 100644 --- a/include/clang/Lex/PPCallbacks.h +++ b/include/clang/Lex/PPCallbacks.h @@ -333,35 +333,31 @@ public: delete First; } - virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason, - SrcMgr::CharacteristicKind FileType, - FileID PrevFID) { + void FileChanged(SourceLocation Loc, FileChangeReason Reason, + SrcMgr::CharacteristicKind FileType, + FileID PrevFID) override { First->FileChanged(Loc, Reason, FileType, PrevFID); Second->FileChanged(Loc, Reason, FileType, PrevFID); } - virtual void FileSkipped(const FileEntry &ParentFile, - const Token &FilenameTok, - SrcMgr::CharacteristicKind FileType) { + void FileSkipped(const FileEntry &ParentFile, + const Token &FilenameTok, + SrcMgr::CharacteristicKind FileType) override { First->FileSkipped(ParentFile, FilenameTok, FileType); Second->FileSkipped(ParentFile, FilenameTok, FileType); } - virtual bool FileNotFound(StringRef FileName, - SmallVectorImpl &RecoveryPath) { + bool FileNotFound(StringRef FileName, + SmallVectorImpl &RecoveryPath) override { return First->FileNotFound(FileName, RecoveryPath) || Second->FileNotFound(FileName, RecoveryPath); } - virtual void InclusionDirective(SourceLocation HashLoc, - const Token &IncludeTok, - StringRef FileName, - bool IsAngled, - CharSourceRange FilenameRange, - const FileEntry *File, - StringRef SearchPath, - StringRef RelativePath, - const Module *Imported) { + void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, + StringRef FileName, bool IsAngled, + CharSourceRange FilenameRange, const FileEntry *File, + StringRef SearchPath, StringRef RelativePath, + const Module *Imported) override { First->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported); @@ -370,147 +366,142 @@ public: Imported); } - virtual void moduleImport(SourceLocation ImportLoc, - ModuleIdPath Path, - const Module *Imported) { + void moduleImport(SourceLocation ImportLoc, ModuleIdPath Path, + const Module *Imported) override { First->moduleImport(ImportLoc, Path, Imported); Second->moduleImport(ImportLoc, Path, Imported); } - virtual void EndOfMainFile() { + void EndOfMainFile() override { First->EndOfMainFile(); Second->EndOfMainFile(); } - virtual void Ident(SourceLocation Loc, const std::string &str) { + void Ident(SourceLocation Loc, const std::string &str) override { First->Ident(Loc, str); Second->Ident(Loc, str); } - virtual void PragmaComment(SourceLocation Loc, const IdentifierInfo *Kind, - const std::string &Str) { + void PragmaComment(SourceLocation Loc, const IdentifierInfo *Kind, + const std::string &Str) override { First->PragmaComment(Loc, Kind, Str); Second->PragmaComment(Loc, Kind, Str); } - virtual void PragmaDetectMismatch(SourceLocation Loc, - const std::string &Name, - const std::string &Value) { + void PragmaDetectMismatch(SourceLocation Loc, const std::string &Name, + const std::string &Value) override { First->PragmaDetectMismatch(Loc, Name, Value); Second->PragmaDetectMismatch(Loc, Name, Value); } - virtual void PragmaMessage(SourceLocation Loc, StringRef Namespace, - PragmaMessageKind Kind, StringRef Str) { + void PragmaMessage(SourceLocation Loc, StringRef Namespace, + PragmaMessageKind Kind, StringRef Str) override { First->PragmaMessage(Loc, Namespace, Kind, Str); Second->PragmaMessage(Loc, Namespace, Kind, Str); } - virtual void PragmaDiagnosticPush(SourceLocation Loc, - StringRef Namespace) { + void PragmaDiagnosticPush(SourceLocation Loc, StringRef Namespace) override { First->PragmaDiagnosticPush(Loc, Namespace); Second->PragmaDiagnosticPush(Loc, Namespace); } - virtual void PragmaDiagnosticPop(SourceLocation Loc, - StringRef Namespace) { + void PragmaDiagnosticPop(SourceLocation Loc, StringRef Namespace) override { First->PragmaDiagnosticPop(Loc, Namespace); Second->PragmaDiagnosticPop(Loc, Namespace); } - virtual void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace, - diag::Mapping mapping, StringRef Str) { + void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace, + diag::Mapping mapping, StringRef Str) override { First->PragmaDiagnostic(Loc, Namespace, mapping, Str); Second->PragmaDiagnostic(Loc, Namespace, mapping, Str); } - virtual void PragmaOpenCLExtension(SourceLocation NameLoc, - const IdentifierInfo *Name, - SourceLocation StateLoc, unsigned State) { + void PragmaOpenCLExtension(SourceLocation NameLoc, const IdentifierInfo *Name, + SourceLocation StateLoc, unsigned State) override { First->PragmaOpenCLExtension(NameLoc, Name, StateLoc, State); Second->PragmaOpenCLExtension(NameLoc, Name, StateLoc, State); } - virtual void PragmaWarning(SourceLocation Loc, StringRef WarningSpec, - ArrayRef Ids) { + void PragmaWarning(SourceLocation Loc, StringRef WarningSpec, + ArrayRef Ids) override { First->PragmaWarning(Loc, WarningSpec, Ids); Second->PragmaWarning(Loc, WarningSpec, Ids); } - virtual void PragmaWarningPush(SourceLocation Loc, int Level) { + void PragmaWarningPush(SourceLocation Loc, int Level) override { First->PragmaWarningPush(Loc, Level); Second->PragmaWarningPush(Loc, Level); } - virtual void PragmaWarningPop(SourceLocation Loc) { + void PragmaWarningPop(SourceLocation Loc) override { First->PragmaWarningPop(Loc); Second->PragmaWarningPop(Loc); } - 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 { First->MacroExpands(MacroNameTok, MD, Range, Args); Second->MacroExpands(MacroNameTok, MD, Range, Args); } - virtual void MacroDefined(const Token &MacroNameTok, const MacroDirective *MD) { + void MacroDefined(const Token &MacroNameTok, const MacroDirective *MD) override { First->MacroDefined(MacroNameTok, MD); Second->MacroDefined(MacroNameTok, MD); } - virtual void MacroUndefined(const Token &MacroNameTok, - const MacroDirective *MD) { + void MacroUndefined(const Token &MacroNameTok, + const MacroDirective *MD) override { First->MacroUndefined(MacroNameTok, MD); Second->MacroUndefined(MacroNameTok, MD); } - virtual void Defined(const Token &MacroNameTok, const MacroDirective *MD, - SourceRange Range) { + void Defined(const Token &MacroNameTok, const MacroDirective *MD, + SourceRange Range) override { First->Defined(MacroNameTok, MD, Range); Second->Defined(MacroNameTok, MD, Range); } - virtual void SourceRangeSkipped(SourceRange Range) { + void SourceRangeSkipped(SourceRange Range) override { First->SourceRangeSkipped(Range); Second->SourceRangeSkipped(Range); } /// \brief Hook called whenever an \#if is seen. - virtual void If(SourceLocation Loc, SourceRange ConditionRange, - ConditionValueKind ConditionValue) { + void If(SourceLocation Loc, SourceRange ConditionRange, + ConditionValueKind ConditionValue) override { First->If(Loc, ConditionRange, ConditionValue); Second->If(Loc, ConditionRange, ConditionValue); } /// \brief Hook called whenever an \#elif is seen. - virtual void Elif(SourceLocation Loc, SourceRange ConditionRange, - ConditionValueKind ConditionValue, SourceLocation IfLoc) { + void Elif(SourceLocation Loc, SourceRange ConditionRange, + ConditionValueKind ConditionValue, SourceLocation IfLoc) override { First->Elif(Loc, ConditionRange, ConditionValue, IfLoc); Second->Elif(Loc, ConditionRange, ConditionValue, IfLoc); } /// \brief Hook called whenever an \#ifdef is seen. - virtual void Ifdef(SourceLocation Loc, const Token &MacroNameTok, - const MacroDirective *MD) { + void Ifdef(SourceLocation Loc, const Token &MacroNameTok, + const MacroDirective *MD) override { First->Ifdef(Loc, MacroNameTok, MD); Second->Ifdef(Loc, MacroNameTok, MD); } /// \brief Hook called whenever an \#ifndef is seen. - virtual void Ifndef(SourceLocation Loc, const Token &MacroNameTok, - const MacroDirective *MD) { + void Ifndef(SourceLocation Loc, const Token &MacroNameTok, + const MacroDirective *MD) override { First->Ifndef(Loc, MacroNameTok, MD); Second->Ifndef(Loc, MacroNameTok, MD); } /// \brief Hook called whenever an \#else is seen. - virtual void Else(SourceLocation Loc, SourceLocation IfLoc) { + void Else(SourceLocation Loc, SourceLocation IfLoc) override { First->Else(Loc, IfLoc); Second->Else(Loc, IfLoc); } /// \brief Hook called whenever an \#endif is seen. - virtual void Endif(SourceLocation Loc, SourceLocation IfLoc) { + void Endif(SourceLocation Loc, SourceLocation IfLoc) override { First->Endif(Loc, IfLoc); Second->Endif(Loc, IfLoc); } diff --git a/include/clang/Lex/PPConditionalDirectiveRecord.h b/include/clang/Lex/PPConditionalDirectiveRecord.h index 9da46cdbfc..00d2d57973 100644 --- a/include/clang/Lex/PPConditionalDirectiveRecord.h +++ b/include/clang/Lex/PPConditionalDirectiveRecord.h @@ -86,16 +86,16 @@ public: SourceLocation findConditionalDirectiveRegionLoc(SourceLocation Loc) const; private: - virtual void If(SourceLocation Loc, SourceRange ConditionRange, - ConditionValueKind ConditionValue); - virtual void Elif(SourceLocation Loc, SourceRange ConditionRange, - ConditionValueKind ConditionValue, SourceLocation IfLoc); - virtual void Ifdef(SourceLocation Loc, const Token &MacroNameTok, - const MacroDirective *MD); - virtual void Ifndef(SourceLocation Loc, const Token &MacroNameTok, - const MacroDirective *MD); - virtual void Else(SourceLocation Loc, SourceLocation IfLoc); - virtual void Endif(SourceLocation Loc, SourceLocation IfLoc); + void If(SourceLocation Loc, SourceRange ConditionRange, + ConditionValueKind ConditionValue) override; + void Elif(SourceLocation Loc, SourceRange ConditionRange, + ConditionValueKind ConditionValue, SourceLocation IfLoc) override; + void Ifdef(SourceLocation Loc, const Token &MacroNameTok, + const MacroDirective *MD) override; + void Ifndef(SourceLocation Loc, const Token &MacroNameTok, + const MacroDirective *MD) override; + void Else(SourceLocation Loc, SourceLocation IfLoc) override; + void Endif(SourceLocation Loc, SourceLocation IfLoc) override; }; } // end namespace clang diff --git a/include/clang/Lex/PTHLexer.h b/include/clang/Lex/PTHLexer.h index d748bc1f7d..2352ccea18 100644 --- a/include/clang/Lex/PTHLexer.h +++ b/include/clang/Lex/PTHLexer.h @@ -90,11 +90,11 @@ public: /// IndirectLex - An indirect call to 'Lex' that can be invoked via /// the PreprocessorLexer interface. - void IndirectLex(Token &Result) { Lex(Result); } + void IndirectLex(Token &Result) override { Lex(Result); } /// getSourceLocation - Return a source location for the token in /// the current file. - SourceLocation getSourceLocation(); + SourceLocation getSourceLocation() override; /// SkipBlock - Used by Preprocessor to skip the current conditional block. bool SkipBlock(); diff --git a/include/clang/Lex/PTHManager.h b/include/clang/Lex/PTHManager.h index fad0806ca3..11b5ceaad1 100644 --- a/include/clang/Lex/PTHManager.h +++ b/include/clang/Lex/PTHManager.h @@ -114,7 +114,7 @@ public: /// Unlike the version in IdentifierTable, this returns a pointer instead /// of a reference. If the pointer is NULL then the IdentifierInfo cannot /// be found. - IdentifierInfo *get(StringRef Name); + IdentifierInfo *get(StringRef Name) override; /// Create - This method creates PTHManager objects. The 'file' argument /// is the name of the PTH file. This method returns NULL upon failure. diff --git a/include/clang/Lex/Pragma.h b/include/clang/Lex/Pragma.h index 087448fbc5..f263820b53 100644 --- a/include/clang/Lex/Pragma.h +++ b/include/clang/Lex/Pragma.h @@ -78,8 +78,8 @@ class EmptyPragmaHandler : public PragmaHandler { public: EmptyPragmaHandler(); - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &FirstToken); + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken) override; }; /// PragmaNamespace - This PragmaHandler subdivides the namespace of pragmas, @@ -114,10 +114,10 @@ public: return Handlers.empty(); } - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &FirstToken); + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken) override; - virtual PragmaNamespace *getIfNamespace() { return this; } + PragmaNamespace *getIfNamespace() override { return this; } }; diff --git a/include/clang/Lex/PreprocessingRecord.h b/include/clang/Lex/PreprocessingRecord.h index c14deecf69..495da76cd3 100644 --- a/include/clang/Lex/PreprocessingRecord.h +++ b/include/clang/Lex/PreprocessingRecord.h @@ -566,28 +566,25 @@ namespace clang { } private: - virtual void MacroExpands(const Token &Id, const MacroDirective *MD, - SourceRange Range, const MacroArgs *Args); - virtual void MacroDefined(const Token &Id, const MacroDirective *MD); - virtual void MacroUndefined(const Token &Id, const MacroDirective *MD); - virtual void InclusionDirective(SourceLocation HashLoc, - const Token &IncludeTok, - StringRef FileName, - bool IsAngled, - CharSourceRange FilenameRange, - const FileEntry *File, - StringRef SearchPath, - StringRef RelativePath, - const Module *Imported); - virtual void Ifdef(SourceLocation Loc, const Token &MacroNameTok, - const MacroDirective *MD); - virtual void Ifndef(SourceLocation Loc, const Token &MacroNameTok, - const MacroDirective *MD); + void MacroExpands(const Token &Id, const MacroDirective *MD, + SourceRange Range, const MacroArgs *Args) override; + void MacroDefined(const Token &Id, const MacroDirective *MD) override; + void MacroUndefined(const Token &Id, const MacroDirective *MD) override; + void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, + StringRef FileName, bool IsAngled, + CharSourceRange FilenameRange, + const FileEntry *File, StringRef SearchPath, + StringRef RelativePath, + const Module *Imported) override; + void Ifdef(SourceLocation Loc, const Token &MacroNameTok, + const MacroDirective *MD) override; + void Ifndef(SourceLocation Loc, const Token &MacroNameTok, + const MacroDirective *MD) override; /// \brief Hook called whenever the 'defined' operator is seen. - virtual void Defined(const Token &MacroNameTok, const MacroDirective *MD, - SourceRange Range); + void Defined(const Token &MacroNameTok, const MacroDirective *MD, + SourceRange Range) override; - virtual void SourceRangeSkipped(SourceRange Range); + void SourceRangeSkipped(SourceRange Range) override; void addMacroExpansion(const Token &Id, const MacroInfo *MI, SourceRange Range); diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp index 7257b18098..8c0865a539 100644 --- a/lib/Lex/PTHLexer.cpp +++ b/lib/Lex/PTHLexer.cpp @@ -675,7 +675,7 @@ public: ~PTHStatCache() {} LookupResult getStat(const char *Path, FileData &Data, bool isFile, - vfs::File **F, vfs::FileSystem &FS) { + vfs::File **F, vfs::FileSystem &FS) override { // Do the lookup for the file's data in the PTH file. CacheTy::iterator I = Cache.find(Path); diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index 2e7fb293cb..99ba8dee2d 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -810,8 +810,8 @@ namespace { /// PragmaOnceHandler - "\#pragma once" marks the file as atomically included. struct PragmaOnceHandler : public PragmaHandler { PragmaOnceHandler() : PragmaHandler("once") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &OnceTok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &OnceTok) override { PP.CheckEndOfDirective("pragma once"); PP.HandlePragmaOnce(OnceTok); } @@ -821,8 +821,8 @@ struct PragmaOnceHandler : public PragmaHandler { /// rest of the line is not lexed. struct PragmaMarkHandler : public PragmaHandler { PragmaMarkHandler() : PragmaHandler("mark") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &MarkTok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &MarkTok) override { PP.HandlePragmaMark(); } }; @@ -830,8 +830,8 @@ struct PragmaMarkHandler : public PragmaHandler { /// PragmaPoisonHandler - "\#pragma poison x" marks x as not usable. struct PragmaPoisonHandler : public PragmaHandler { PragmaPoisonHandler() : PragmaHandler("poison") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &PoisonTok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &PoisonTok) override { PP.HandlePragmaPoison(PoisonTok); } }; @@ -840,24 +840,24 @@ struct PragmaPoisonHandler : public PragmaHandler { /// as a system header, which silences warnings in it. struct PragmaSystemHeaderHandler : public PragmaHandler { PragmaSystemHeaderHandler() : PragmaHandler("system_header") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &SHToken) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &SHToken) override { PP.HandlePragmaSystemHeader(SHToken); PP.CheckEndOfDirective("pragma"); } }; struct PragmaDependencyHandler : public PragmaHandler { PragmaDependencyHandler() : PragmaHandler("dependency") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &DepToken) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &DepToken) override { PP.HandlePragmaDependency(DepToken); } }; struct PragmaDebugHandler : public PragmaHandler { PragmaDebugHandler() : PragmaHandler("__debug") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &DepToken) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &DepToken) override { Token Tok; PP.LexUnexpandedToken(Tok); if (Tok.isNot(tok::identifier)) { @@ -941,8 +941,8 @@ private: public: explicit PragmaDiagnosticHandler(const char *NS) : PragmaHandler("diagnostic"), Namespace(NS) {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &DiagToken) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &DiagToken) override { SourceLocation DiagLoc = DiagToken.getLocation(); Token Tok; PP.LexUnexpandedToken(Tok); @@ -1012,8 +1012,8 @@ public: struct PragmaWarningHandler : public PragmaHandler { PragmaWarningHandler() : PragmaHandler("warning") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &Tok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &Tok) override { // Parse things like: // warning(push, 1) // warning(pop) @@ -1119,8 +1119,8 @@ struct PragmaWarningHandler : public PragmaHandler { /// PragmaIncludeAliasHandler - "\#pragma include_alias("...")". struct PragmaIncludeAliasHandler : public PragmaHandler { PragmaIncludeAliasHandler() : PragmaHandler("include_alias") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &IncludeAliasTok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &IncludeAliasTok) override { PP.HandlePragmaIncludeAlias(IncludeAliasTok); } }; @@ -1161,8 +1161,8 @@ public: StringRef Namespace = StringRef()) : PragmaHandler(PragmaKind(Kind, true)), Kind(Kind), Namespace(Namespace) {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &Tok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &Tok) override { SourceLocation MessageLoc = Tok.getLocation(); PP.Lex(Tok); bool ExpectClosingParen = false; @@ -1214,8 +1214,8 @@ public: /// macro on the top of the stack. struct PragmaPushMacroHandler : public PragmaHandler { PragmaPushMacroHandler() : PragmaHandler("push_macro") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &PushMacroTok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &PushMacroTok) override { PP.HandlePragmaPushMacro(PushMacroTok); } }; @@ -1225,8 +1225,8 @@ struct PragmaPushMacroHandler : public PragmaHandler { /// macro to the value on the top of the stack. struct PragmaPopMacroHandler : public PragmaHandler { PragmaPopMacroHandler() : PragmaHandler("pop_macro") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &PopMacroTok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &PopMacroTok) override { PP.HandlePragmaPopMacro(PopMacroTok); } }; @@ -1236,8 +1236,8 @@ struct PragmaPopMacroHandler : public PragmaHandler { /// PragmaSTDC_FENV_ACCESSHandler - "\#pragma STDC FENV_ACCESS ...". struct PragmaSTDC_FENV_ACCESSHandler : public PragmaHandler { PragmaSTDC_FENV_ACCESSHandler() : PragmaHandler("FENV_ACCESS") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &Tok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &Tok) override { tok::OnOffSwitch OOS; if (PP.LexOnOffSwitch(OOS)) return; @@ -1250,8 +1250,8 @@ struct PragmaSTDC_FENV_ACCESSHandler : public PragmaHandler { struct PragmaSTDC_CX_LIMITED_RANGEHandler : public PragmaHandler { PragmaSTDC_CX_LIMITED_RANGEHandler() : PragmaHandler("CX_LIMITED_RANGE") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &Tok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &Tok) override { tok::OnOffSwitch OOS; PP.LexOnOffSwitch(OOS); } @@ -1260,8 +1260,8 @@ struct PragmaSTDC_CX_LIMITED_RANGEHandler : public PragmaHandler { /// PragmaSTDC_UnknownHandler - "\#pragma STDC ...". struct PragmaSTDC_UnknownHandler : public PragmaHandler { PragmaSTDC_UnknownHandler() {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &UnknownTok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &UnknownTok) override { // C99 6.10.6p2, unknown forms are not allowed. PP.Diag(UnknownTok, diag::ext_stdc_pragma_ignored); } @@ -1271,8 +1271,8 @@ struct PragmaSTDC_UnknownHandler : public PragmaHandler { /// \#pragma clang arc_cf_code_audited begin/end struct PragmaARCCFCodeAuditedHandler : public PragmaHandler { PragmaARCCFCodeAuditedHandler() : PragmaHandler("arc_cf_code_audited") {} - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &NameTok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &NameTok) override { SourceLocation Loc = NameTok.getLocation(); bool IsBegin; @@ -1335,8 +1335,8 @@ struct PragmaARCCFCodeAuditedHandler : public PragmaHandler { struct PragmaRegionHandler : public PragmaHandler { PragmaRegionHandler(const char *pragma) : PragmaHandler(pragma) { } - virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, - Token &NameTok) { + void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &NameTok) override { // #pragma region: endregion matches can be verified // __pragma(region): no sense, but ignored by msvc // _Pragma is not valid for MSVC, but there isn't any point -- cgit v1.2.3