summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/ASTConsumers.cpp10
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp82
-rw-r--r--clang/lib/Frontend/CacheTokens.cpp2
-rw-r--r--clang/lib/Frontend/DependencyFile.cpp30
-rw-r--r--clang/lib/Frontend/DependencyGraph.cpp16
-rw-r--r--clang/lib/Frontend/DiagnosticRenderer.cpp4
-rw-r--r--clang/lib/Frontend/FrontendAction.cpp20
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp20
-rw-r--r--clang/lib/Frontend/HeaderIncludeGen.cpp6
-rw-r--r--clang/lib/Frontend/MultiplexConsumer.cpp51
-rw-r--r--clang/lib/Frontend/PrintPreprocessedOutput.cpp58
-rw-r--r--clang/lib/Frontend/SerializedDiagnosticPrinter.cpp63
-rw-r--r--clang/lib/Frontend/VerifyDiagnosticConsumer.cpp8
13 files changed, 178 insertions, 192 deletions
diff --git a/clang/lib/Frontend/ASTConsumers.cpp b/clang/lib/Frontend/ASTConsumers.cpp
index aee8cd71675..054148660e0 100644
--- a/clang/lib/Frontend/ASTConsumers.cpp
+++ b/clang/lib/Frontend/ASTConsumers.cpp
@@ -41,7 +41,7 @@ namespace {
: Out(Out ? *Out : llvm::outs()), Dump(Dump),
FilterString(FilterString), DumpLookups(DumpLookups) {}
- virtual void HandleTranslationUnit(ASTContext &Context) {
+ void HandleTranslationUnit(ASTContext &Context) override {
TranslationUnitDecl *D = Context.getTranslationUnitDecl();
if (FilterString.empty())
@@ -101,7 +101,7 @@ namespace {
ASTDeclNodeLister(raw_ostream *Out = NULL)
: Out(Out ? *Out : llvm::outs()) {}
- virtual void HandleTranslationUnit(ASTContext &Context) {
+ void HandleTranslationUnit(ASTContext &Context) override {
TraverseDecl(Context.getTranslationUnitDecl());
}
@@ -138,11 +138,11 @@ namespace {
class ASTViewer : public ASTConsumer {
ASTContext *Context;
public:
- void Initialize(ASTContext &Context) {
+ void Initialize(ASTContext &Context) override {
this->Context = &Context;
}
- virtual bool HandleTopLevelDecl(DeclGroupRef D) {
+ bool HandleTopLevelDecl(DeclGroupRef D) override {
for (DeclGroupRef::iterator I = D.begin(), E = D.end(); I != E; ++I)
HandleTopLevelSingleDecl(*I);
return true;
@@ -177,7 +177,7 @@ class DeclContextPrinter : public ASTConsumer {
public:
DeclContextPrinter() : Out(llvm::errs()) {}
- void HandleTranslationUnit(ASTContext &C) {
+ void HandleTranslationUnit(ASTContext &C) override {
PrintDeclContext(C.getTranslationUnitDecl(), 4);
}
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 7b5e91592ca..c4f7596e003 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -519,8 +519,8 @@ public:
Counter(Counter),
InitializedLanguage(false) {}
- virtual bool ReadLanguageOptions(const LangOptions &LangOpts,
- bool Complain) {
+ bool ReadLanguageOptions(const LangOptions &LangOpts,
+ bool Complain) override {
if (InitializedLanguage)
return false;
@@ -531,8 +531,8 @@ public:
return false;
}
- virtual bool ReadTargetOptions(const TargetOptions &TargetOpts,
- bool Complain) {
+ bool ReadTargetOptions(const TargetOptions &TargetOpts,
+ bool Complain) override {
// If we've already initialized the target, don't do it again.
if (Target)
return false;
@@ -545,7 +545,8 @@ public:
return false;
}
- virtual void ReadCounter(const serialization::ModuleFile &M, unsigned Value) {
+ void ReadCounter(const serialization::ModuleFile &M,
+ unsigned Value) override {
Counter = Value;
}
@@ -583,14 +584,14 @@ public:
SmallVectorImpl<StoredDiagnostic> &StoredDiags)
: StoredDiags(StoredDiags), SourceMgr(0) { }
- virtual void BeginSourceFile(const LangOptions &LangOpts,
- const Preprocessor *PP = 0) {
+ void BeginSourceFile(const LangOptions &LangOpts,
+ const Preprocessor *PP = 0) override {
if (PP)
SourceMgr = &PP->getSourceManager();
}
- virtual void HandleDiagnostic(DiagnosticsEngine::Level Level,
- const Diagnostic &Info);
+ void HandleDiagnostic(DiagnosticsEngine::Level Level,
+ const Diagnostic &Info) override;
};
/// \brief RAII object that optionally captures diagnostics, if
@@ -793,9 +794,9 @@ class MacroDefinitionTrackerPPCallbacks : public PPCallbacks {
public:
explicit MacroDefinitionTrackerPPCallbacks(unsigned &Hash) : Hash(Hash) { }
-
- virtual void MacroDefined(const Token &MacroNameTok,
- const MacroDirective *MD) {
+
+ void MacroDefined(const Token &MacroNameTok,
+ const MacroDirective *MD) override {
Hash = llvm::HashString(MacroNameTok.getIdentifierInfo()->getName(), Hash);
}
};
@@ -877,25 +878,25 @@ public:
}
}
- bool HandleTopLevelDecl(DeclGroupRef D) {
+ bool HandleTopLevelDecl(DeclGroupRef D) override {
for (DeclGroupRef::iterator it = D.begin(), ie = D.end(); it != ie; ++it)
handleTopLevelDecl(*it);
return true;
}
// We're not interested in "interesting" decls.
- void HandleInterestingDecl(DeclGroupRef) {}
+ void HandleInterestingDecl(DeclGroupRef) override {}
- void HandleTopLevelDeclInObjCContainer(DeclGroupRef D) {
+ void HandleTopLevelDeclInObjCContainer(DeclGroupRef D) override {
for (DeclGroupRef::iterator it = D.begin(), ie = D.end(); it != ie; ++it)
handleTopLevelDecl(*it);
}
- virtual ASTMutationListener *GetASTMutationListener() {
+ ASTMutationListener *GetASTMutationListener() override {
return Unit.getASTMutationListener();
}
- virtual ASTDeserializationListener *GetASTDeserializationListener() {
+ ASTDeserializationListener *GetASTDeserializationListener() override {
return Unit.getDeserializationListener();
}
};
@@ -904,8 +905,8 @@ class TopLevelDeclTrackerAction : public ASTFrontendAction {
public:
ASTUnit &Unit;
- virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
- StringRef InFile) {
+ ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
+ StringRef InFile) override {
CI.getPreprocessor().addPPCallbacks(
new MacroDefinitionTrackerPPCallbacks(Unit.getCurrentTopLevelHashValue()));
return new TopLevelDeclTrackerConsumer(Unit,
@@ -915,8 +916,8 @@ public:
public:
TopLevelDeclTrackerAction(ASTUnit &_Unit) : Unit(_Unit) {}
- virtual bool hasCodeCompletionSupport() const { return false; }
- virtual TranslationUnitKind getTranslationUnitKind() {
+ bool hasCodeCompletionSupport() const override { return false; }
+ TranslationUnitKind getTranslationUnitKind() override {
return Unit.getTranslationUnitKind();
}
};
@@ -929,15 +930,15 @@ public:
explicit PrecompilePreambleAction(ASTUnit &Unit)
: Unit(Unit), HasEmittedPreamblePCH(false) {}
- virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
- StringRef InFile);
+ ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
+ StringRef InFile) override;
bool hasEmittedPreamblePCH() const { return HasEmittedPreamblePCH; }
void setHasEmittedPreamblePCH() { HasEmittedPreamblePCH = true; }
- virtual bool shouldEraseOutputFiles() { return !hasEmittedPreamblePCH(); }
+ bool shouldEraseOutputFiles() override { return !hasEmittedPreamblePCH(); }
- virtual bool hasCodeCompletionSupport() const { return false; }
- virtual bool hasASTFileSupport() const { return false; }
- virtual TranslationUnitKind getTranslationUnitKind() { return TU_Prefix; }
+ bool hasCodeCompletionSupport() const override { return false; }
+ bool hasASTFileSupport() const override { return false; }
+ TranslationUnitKind getTranslationUnitKind() override { return TU_Prefix; }
};
class PrecompilePreambleConsumer : public PCHGenerator {
@@ -955,7 +956,7 @@ public:
Hash = 0;
}
- virtual bool HandleTopLevelDecl(DeclGroupRef D) {
+ bool HandleTopLevelDecl(DeclGroupRef D) override {
for (DeclGroupRef::iterator it = D.begin(), ie = D.end(); it != ie; ++it) {
Decl *D = *it;
// FIXME: Currently ObjC method declarations are incorrectly being
@@ -970,7 +971,7 @@ public:
return true;
}
- virtual void HandleTranslationUnit(ASTContext &Ctx) {
+ void HandleTranslationUnit(ASTContext &Ctx) override {
PCHGenerator::HandleTranslationUnit(Ctx);
if (hasEmittedPCH()) {
// Translate the top-level declarations we captured during
@@ -2141,23 +2142,22 @@ namespace {
| (1LL << CodeCompletionContext::CCC_UnionTag)
| (1LL << CodeCompletionContext::CCC_ClassOrStructTag);
}
-
- virtual void ProcessCodeCompleteResults(Sema &S,
- CodeCompletionContext Context,
- CodeCompletionResult *Results,
- unsigned NumResults);
-
- virtual void ProcessOverloadCandidates(Sema &S, unsigned CurrentArg,
- OverloadCandidate *Candidates,
- unsigned NumCandidates) {
+
+ void ProcessCodeCompleteResults(Sema &S, CodeCompletionContext Context,
+ CodeCompletionResult *Results,
+ unsigned NumResults) override;
+
+ void ProcessOverloadCandidates(Sema &S, unsigned CurrentArg,
+ OverloadCandidate *Candidates,
+ unsigned NumCandidates) override {
Next.ProcessOverloadCandidates(S, CurrentArg, Candidates, NumCandidates);
}
-
- virtual CodeCompletionAllocator &getAllocator() {
+
+ CodeCompletionAllocator &getAllocator() override {
return Next.getAllocator();
}
- virtual CodeCompletionTUInfo &getCodeCompletionTUInfo() {
+ CodeCompletionTUInfo &getCodeCompletionTUInfo() override {
return Next.getCodeCompletionTUInfo();
}
};
diff --git a/clang/lib/Frontend/CacheTokens.cpp b/clang/lib/Frontend/CacheTokens.cpp
index 5cb364e3f5c..0fca5130c5f 100644
--- a/clang/lib/Frontend/CacheTokens.cpp
+++ b/clang/lib/Frontend/CacheTokens.cpp
@@ -516,7 +516,7 @@ public:
~StatListener() {}
LookupResult getStat(const char *Path, FileData &Data, bool isFile,
- vfs::File **F, vfs::FileSystem &FS) {
+ vfs::File **F, vfs::FileSystem &FS) override {
LookupResult Result = statChained(Path, Data, isFile, F, FS);
if (Result == CacheMissing) // Failed 'stat'.
diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp
index 175a2c9a264..e27381bf779 100644
--- a/clang/lib/Frontend/DependencyFile.cpp
+++ b/clang/lib/Frontend/DependencyFile.cpp
@@ -53,20 +53,16 @@ public:
AddMissingHeaderDeps(Opts.AddMissingHeaderDeps),
SeenMissingHeader(false) {}
- virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason,
- SrcMgr::CharacteristicKind FileType,
- FileID PrevFID);
- 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 EndOfMainFile() {
+ void FileChanged(SourceLocation Loc, FileChangeReason Reason,
+ SrcMgr::CharacteristicKind FileType,
+ FileID PrevFID) 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 EndOfMainFile() override {
OutputDependencyFile();
}
@@ -79,11 +75,11 @@ class DFGASTReaderListener : public ASTReaderListener {
public:
DFGASTReaderListener(DFGImpl &Parent)
: Parent(Parent) { }
- virtual bool needsInputFileVisitation() { return true; }
- virtual bool needsSystemInputFileVisitation() {
+ bool needsInputFileVisitation() override { return true; }
+ bool needsSystemInputFileVisitation() override {
return Parent.includeSystemHeaders();
}
- virtual bool visitInputFile(StringRef Filename, bool isSystem);
+ bool visitInputFile(StringRef Filename, bool isSystem) override;
};
}
diff --git a/clang/lib/Frontend/DependencyGraph.cpp b/clang/lib/Frontend/DependencyGraph.cpp
index 6f12e630561..4bff3dba9e4 100644
--- a/clang/lib/Frontend/DependencyGraph.cpp
+++ b/clang/lib/Frontend/DependencyGraph.cpp
@@ -46,17 +46,13 @@ public:
StringRef SysRoot)
: PP(_PP), OutputFile(OutputFile.str()), SysRoot(SysRoot.str()) { }
- 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;
- virtual void EndOfMainFile() {
+ void EndOfMainFile() override {
OutputGraphFile();
}
diff --git a/clang/lib/Frontend/DiagnosticRenderer.cpp b/clang/lib/Frontend/DiagnosticRenderer.cpp
index b52f0103e6b..85e87a21ed1 100644
--- a/clang/lib/Frontend/DiagnosticRenderer.cpp
+++ b/clang/lib/Frontend/DiagnosticRenderer.cpp
@@ -79,10 +79,10 @@ class FixitReceiver : public edit::EditsReceiver {
public:
FixitReceiver(SmallVectorImpl<FixItHint> &MergedFixits)
: MergedFixits(MergedFixits) { }
- virtual void insert(SourceLocation loc, StringRef text) {
+ void insert(SourceLocation loc, StringRef text) override {
MergedFixits.push_back(FixItHint::CreateInsertion(loc, text));
}
- virtual void replace(CharSourceRange range, StringRef text) {
+ void replace(CharSourceRange range, StringRef text) override {
MergedFixits.push_back(FixItHint::CreateReplacement(range, text));
}
};
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index 24f2ec496cd..d2ece7e732d 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -43,29 +43,29 @@ public:
ASTDeserializationListener *Previous)
: Previous(Previous) { }
- virtual void ReaderInitialized(ASTReader *Reader) {
+ void ReaderInitialized(ASTReader *Reader) override {
if (Previous)
Previous->ReaderInitialized(Reader);
}
- virtual void IdentifierRead(serialization::IdentID ID,
- IdentifierInfo *II) {
+ void IdentifierRead(serialization::IdentID ID,
+ IdentifierInfo *II) override {
if (Previous)
Previous->IdentifierRead(ID, II);
}
- virtual void TypeRead(serialization::TypeIdx Idx, QualType T) {
+ void TypeRead(serialization::TypeIdx Idx, QualType T) override {
if (Previous)
Previous->TypeRead(Idx, T);
}
- virtual void DeclRead(serialization::DeclID ID, const Decl *D) {
+ void DeclRead(serialization::DeclID ID, const Decl *D) override {
if (Previous)
Previous->DeclRead(ID, D);
}
- virtual void SelectorRead(serialization::SelectorID ID, Selector Sel) {
+ void SelectorRead(serialization::SelectorID ID, Selector Sel) override {
if (Previous)
Previous->SelectorRead(ID, Sel);
}
- virtual void MacroDefinitionRead(serialization::PreprocessedEntityID PPID,
- MacroDefinition *MD) {
+ void MacroDefinitionRead(serialization::PreprocessedEntityID PPID,
+ MacroDefinition *MD) override {
if (Previous)
Previous->MacroDefinitionRead(PPID, MD);
}
@@ -77,7 +77,7 @@ public:
explicit DeserializedDeclsDumper(ASTDeserializationListener *Previous)
: DelegatingDeserializationListener(Previous) { }
- virtual void DeclRead(serialization::DeclID ID, const Decl *D) {
+ void DeclRead(serialization::DeclID ID, const Decl *D) override {
llvm::outs() << "PCH DECL: " << D->getDeclKindName();
if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
llvm::outs() << " - " << *ND;
@@ -100,7 +100,7 @@ public:
: DelegatingDeserializationListener(Previous),
Ctx(Ctx), NamesToCheck(NamesToCheck) { }
- virtual void DeclRead(serialization::DeclID ID, const Decl *D) {
+ void DeclRead(serialization::DeclID ID, const Decl *D) override {
if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
if (NamesToCheck.find(ND->getNameAsString()) != NamesToCheck.end()) {
unsigned DiagID
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 786fadb2fe6..2657c9878b8 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -403,7 +403,7 @@ namespace {
#define DUMP_BOOLEAN(Value, Text) \
Out.indent(4) << Text << ": " << (Value? "Yes" : "No") << "\n"
- virtual bool ReadFullVersionInformation(StringRef FullVersion) {
+ bool ReadFullVersionInformation(StringRef FullVersion) override {
Out.indent(2)
<< "Generated by "
<< (FullVersion == getClangFullRepositoryVersion()? "this"
@@ -412,8 +412,8 @@ namespace {
return ASTReaderListener::ReadFullVersionInformation(FullVersion);
}
- virtual bool ReadLanguageOptions(const LangOptions &LangOpts,
- bool Complain) {
+ bool ReadLanguageOptions(const LangOptions &LangOpts,
+ bool Complain) override {
Out.indent(2) << "Language options:\n";
#define LANGOPT(Name, Bits, Default, Description) \
DUMP_BOOLEAN(LangOpts.Name, Description);
@@ -428,8 +428,8 @@ namespace {
return false;
}
- virtual bool ReadTargetOptions(const TargetOptions &TargetOpts,
- bool Complain) {
+ bool ReadTargetOptions(const TargetOptions &TargetOpts,
+ bool Complain) override {
Out.indent(2) << "Target options:\n";
Out.indent(4) << " Triple: " << TargetOpts.Triple << "\n";
Out.indent(4) << " CPU: " << TargetOpts.CPU << "\n";
@@ -447,8 +447,8 @@ namespace {
return false;
}
- virtual bool ReadHeaderSearchOptions(const HeaderSearchOptions &HSOpts,
- bool Complain) {
+ bool ReadHeaderSearchOptions(const HeaderSearchOptions &HSOpts,
+ bool Complain) override {
Out.indent(2) << "Header search options:\n";
Out.indent(4) << "System root [-isysroot=]: '" << HSOpts.Sysroot << "'\n";
DUMP_BOOLEAN(HSOpts.UseBuiltinIncludes,
@@ -462,9 +462,9 @@ namespace {
return false;
}
- virtual bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts,
- bool Complain,
- std::string &SuggestedPredefines) {
+ bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts,
+ bool Complain,
+ std::string &SuggestedPredefines) override {
Out.indent(2) << "Preprocessor options:\n";
DUMP_BOOLEAN(PPOpts.UsePredefines,
"Uses compiler/target-specific predefines [-undef]");
diff --git a/clang/lib/Frontend/HeaderIncludeGen.cpp b/clang/lib/Frontend/HeaderIncludeGen.cpp
index 00ff63746c9..6d2e3783211 100644
--- a/clang/lib/Frontend/HeaderIncludeGen.cpp
+++ b/clang/lib/Frontend/HeaderIncludeGen.cpp
@@ -40,9 +40,9 @@ public:
delete OutputFile;
}
- virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason,
- SrcMgr::CharacteristicKind FileType,
- FileID PrevFID);
+ void FileChanged(SourceLocation Loc, FileChangeReason Reason,
+ SrcMgr::CharacteristicKind FileType,
+ FileID PrevFID) override;
};
}
diff --git a/clang/lib/Frontend/MultiplexConsumer.cpp b/clang/lib/Frontend/MultiplexConsumer.cpp
index ca7e6d35b19..4b4804f0350 100644
--- a/clang/lib/Frontend/MultiplexConsumer.cpp
+++ b/clang/lib/Frontend/MultiplexConsumer.cpp
@@ -30,14 +30,14 @@ public:
// Does NOT take ownership of the elements in L.
MultiplexASTDeserializationListener(
const std::vector<ASTDeserializationListener*>& L);
- virtual void ReaderInitialized(ASTReader *Reader);
- virtual void IdentifierRead(serialization::IdentID ID,
- IdentifierInfo *II);
- virtual void TypeRead(serialization::TypeIdx Idx, QualType T);
- virtual void DeclRead(serialization::DeclID ID, const Decl *D);
- virtual void SelectorRead(serialization::SelectorID iD, Selector Sel);
- virtual void MacroDefinitionRead(serialization::PreprocessedEntityID,
- MacroDefinition *MD);
+ void ReaderInitialized(ASTReader *Reader) override;
+ void IdentifierRead(serialization::IdentID ID,
+ IdentifierInfo *II) override;
+ void TypeRead(serialization::TypeIdx Idx, QualType T) override;
+ void DeclRead(serialization::DeclID ID, const Decl *D) override;
+ void SelectorRead(serialization::SelectorID iD, Selector Sel) override;
+ void MacroDefinitionRead(serialization::PreprocessedEntityID,
+ MacroDefinition *MD) override;
private:
std::vector<ASTDeserializationListener*> Listeners;
};
@@ -89,24 +89,23 @@ class MultiplexASTMutationListener : public ASTMutationListener {
public:
// Does NOT take ownership of the elements in L.
MultiplexASTMutationListener(ArrayRef<ASTMutationListener*> L);
- virtual void CompletedTagDefinition(const TagDecl *D);
- virtual void AddedVisibleDecl(const DeclContext *DC, const Decl *D);
- virtual void AddedCXXImplicitMember(const CXXRecordDecl *RD, const Decl *D);
- virtual void AddedCXXTemplateSpecialization(const ClassTemplateDecl *TD,
- const ClassTemplateSpecializationDecl *D);
- virtual void
- AddedCXXTemplateSpecialization(const VarTemplateDecl *TD,
- const VarTemplateSpecializationDecl *D);
- virtual void AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD,
- const FunctionDecl *D);
- virtual void DeducedReturnType(const FunctionDecl *FD, QualType ReturnType);
- virtual void CompletedImplicitDefinition(const FunctionDecl *D);
- virtual void StaticDataMemberInstantiated(const VarDecl *D);
- virtual void AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD,
- const ObjCInterfaceDecl *IFD);
- virtual void AddedObjCPropertyInClassExtension(const ObjCPropertyDecl *Prop,
- const ObjCPropertyDecl *OrigProp,
- const ObjCCategoryDecl *ClassExt);
+ void CompletedTagDefinition(const TagDecl *D) override;
+ void AddedVisibleDecl(const DeclContext *DC, const Decl *D) override;
+ void AddedCXXImplicitMember(const CXXRecordDecl *RD, const Decl *D) override;
+ void AddedCXXTemplateSpecialization(const ClassTemplateDecl *TD,
+ const ClassTemplateSpecializationDecl *D) override;
+ void AddedCXXTemplateSpecialization(const VarTemplateDecl *TD,
+ const VarTemplateSpecializationDecl *D) override;
+ void AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD,
+ const FunctionDecl *D) override;
+ void DeducedReturnType(const FunctionDecl *FD, QualType ReturnType) override;
+ void CompletedImplicitDefinition(const FunctionDecl *D) override;
+ void StaticDataMemberInstantiated(const VarDecl *D) override;
+ void AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD,
+ const ObjCInterfaceDecl *IFD) override;
+ void AddedObjCPropertyInClassExtension(const ObjCPropertyDecl *Prop,
+ const ObjCPropertyDecl *OrigProp,
+ const ObjCCategoryDecl *ClassExt) override;
void DeclarationMarkedUsed(const Decl *D) override;
private:
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
index 20d7cd3a8c0..b7b03f99ae2 100644
--- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -123,34 +123,28 @@ public:
}
bool startNewLineIfNeeded(bool ShouldUpdateCurrentLine = true);
-
- virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason,
- SrcMgr::CharacteristicKind FileType,
- FileID PrevFID);
- 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 Ident(SourceLocation Loc, const std::string &str);
+
+ void FileChanged(SourceLocation Loc, FileChangeReason Reason,
+ SrcMgr::CharacteristicKind FileType,
+ FileID PrevFID) 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 Ident(SourceLocation Loc, const std::string &str) override;
virtual void PragmaCaptured(SourceLocation Loc, StringRef Str);
- virtual void PragmaMessage(SourceLocation Loc, StringRef Namespace,
- PragmaMessageKind Kind, StringRef Str);
- virtual void PragmaDebug(SourceLocation Loc, StringRef DebugType);
- virtual void PragmaDiagnosticPush(SourceLocation Loc,
- StringRef Namespace);
- virtual void PragmaDiagnosticPop(SourceLocation Loc,
- StringRef Namespace);
- virtual void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace,
- diag::Mapping Map, StringRef Str);
- virtual void PragmaWarning(SourceLocation Loc, StringRef WarningSpec,
- ArrayRef<int> Ids);
- virtual void PragmaWarningPush(SourceLocation Loc, int Level);
- virtual void PragmaWarningPop(SourceLocation Loc);
+ void PragmaMessage(SourceLocation Loc, StringRef Namespace,
+ PragmaMessageKind Kind, StringRef Str) override;
+ void PragmaDebug(SourceLocation Loc, StringRef DebugType) override;
+ void PragmaDiagnosticPush(SourceLocation Loc, StringRef Namespace) override;
+ void PragmaDiagnosticPop(SourceLocation Loc, StringRef Namespace) override;
+ void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace,
+ diag::Mapping Map, StringRef Str) override;
+ void PragmaWarning(SourceLocation Loc, StringRef WarningSpec,
+ ArrayRef<int> Ids) override;
+ void PragmaWarningPush(SourceLocation Loc, int Level) override;
+ void PragmaWarningPop(SourceLocation Loc) override;
bool HandleFirstTokOnLine(Token &Tok);
@@ -174,10 +168,12 @@ public:
void HandleNewlinesInToken(const char *TokStr, unsigned Len);
/// MacroDefined - This hook is called whenever a macro definition is seen.
- void MacroDefined(const Token &MacroNameTok, const MacroDirective *MD);
+ void MacroDefined(const Token &MacroNameTok,
+ const MacroDirective *MD) override;
/// MacroUndefined - This hook is called whenever a macro #undef is seen.
- void MacroUndefined(const Token &MacroNameTok, const MacroDirective *MD);
+ void MacroUndefined(const Token &MacroNameTok,
+ const MacroDirective *MD) override;
};
} // end anonymous namespace
@@ -577,8 +573,8 @@ struct UnknownPragmaHandler : public PragmaHandler {
UnknownPragmaHandler(const char *prefix, PrintPPOutputPPCallbacks *callbacks)
: Prefix(prefix), Callbacks(callbacks) {}
- virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
- Token &PragmaTok) {
+ void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
+ Token &PragmaTok) override {
// Figure out what line we went to and insert the appropriate number of
// newline characters.
Callbacks->startNewLineIfNeeded();
diff --git a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
index 76784357683..527f727b37d 100644
--- a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
+++ b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
@@ -59,32 +59,32 @@ public:
virtual ~SDiagsRenderer() {}
protected:
- virtual void emitDiagnosticMessage(SourceLocation Loc,
- PresumedLoc PLoc,
- DiagnosticsEngine::Level Level,
- StringRef Message,
- ArrayRef<CharSourceRange> Ranges,
- const SourceManager *SM,
- DiagOrStoredDiag D);
-
- virtual void emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc,
- DiagnosticsEngine::Level Level,
- ArrayRef<CharSourceRange> Ranges,
- const SourceManager &SM) {}
-
- virtual void emitNote(SourceLocation Loc, StringRef Message,
- const SourceManager *SM);
-
- virtual void emitCodeContext(SourceLocation Loc,
- DiagnosticsEngine::Level Level,
- SmallVectorImpl<CharSourceRange>& Ranges,
- ArrayRef<FixItHint> Hints,
- const SourceManager &SM);
-
- virtual void beginDiagnostic(DiagOrStoredDiag D,
- DiagnosticsEngine::Level Level);
- virtual void endDiagnostic(DiagOrStoredDiag D,
- DiagnosticsEngine::Level Level);
+ void emitDiagnosticMessage(SourceLocation Loc,
+ PresumedLoc PLoc,
+ DiagnosticsEngine::Level Level,
+ StringRef Message,
+ ArrayRef<CharSourceRange> Ranges,
+ const SourceManager *SM,
+ DiagOrStoredDiag D) override;
+
+ void emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc,
+ DiagnosticsEngine::Level Level,
+ ArrayRef<CharSourceRange> Ranges,
+ const SourceManager &SM) override {}
+
+ void emitNote(SourceLocation Loc, StringRef Message,
+ const SourceManager *SM) override;
+
+ void emitCodeContext(SourceLocation Loc,
+ DiagnosticsEngine::Level Level,
+ SmallVectorImpl<CharSourceRange>& Ranges,
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM) override;
+
+ void beginDiagnostic(DiagOrStoredDiag D,
+ DiagnosticsEngine::Level Level) override;
+ void endDiagnostic(DiagOrStoredDiag D,
+ DiagnosticsEngine::Level Level) override;
};
class SDiagsWriter : public DiagnosticConsumer {
@@ -103,16 +103,15 @@ public:
}
~SDiagsWriter() {}
-
+
void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
- const Diagnostic &Info);
-
- void BeginSourceFile(const LangOptions &LO,
- const Preprocessor *PP) {
+ const Diagnostic &Info) override;
+
+ void BeginSourceFile(const LangOptions &LO, const Preprocessor *PP) override {
LangOpts = &LO;
}
- virtual void finish();
+ void finish() override;
private:
/// \brief Emit the preamble for the serialized diagnostics.
diff --git a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
index 40992fec3f6..0221a5550c0 100644
--- a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -166,12 +166,12 @@ public:
StringRef Text, unsigned Min, unsigned Max)
: Directive(DirectiveLoc, DiagnosticLoc, Text, Min, Max) { }
- virtual bool isValid(std::string &Error) {
+ bool isValid(std::string &Error) override {
// all strings are considered valid; even empty ones
return true;
}
- virtual bool match(StringRef S) {
+ bool match(StringRef S) override {
return S.find(Text) != StringRef::npos;
}
};
@@ -184,13 +184,13 @@ public:
StringRef Text, unsigned Min, unsigned Max, StringRef RegexStr)
: Directive(DirectiveLoc, DiagnosticLoc, Text, Min, Max), Regex(RegexStr) { }
- virtual bool isValid(std::string &Error) {
+ bool isValid(std::string &Error) override {
if (Regex.isValid(Error))
return true;
return false;
}
- virtual bool match(StringRef S) {
+ bool match(StringRef S) override {
return Regex.match(S);
}
OpenPOWER on IntegriCloud