summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/modularize
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/modularize')
-rw-r--r--clang-tools-extra/modularize/CoverageChecker.cpp12
-rw-r--r--clang-tools-extra/modularize/Modularize.cpp6
-rw-r--r--clang-tools-extra/modularize/PreprocessorTracker.cpp35
3 files changed, 28 insertions, 25 deletions
diff --git a/clang-tools-extra/modularize/CoverageChecker.cpp b/clang-tools-extra/modularize/CoverageChecker.cpp
index 257dbca5918..204e2e44eab 100644
--- a/clang-tools-extra/modularize/CoverageChecker.cpp
+++ b/clang-tools-extra/modularize/CoverageChecker.cpp
@@ -83,14 +83,14 @@ namespace sys = llvm::sys;
class CoverageCheckerCallbacks : public PPCallbacks {
public:
CoverageCheckerCallbacks(CoverageChecker &Checker) : Checker(Checker) {}
- ~CoverageCheckerCallbacks() {}
+ ~CoverageCheckerCallbacks() override {}
// Include directive callback.
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
- StringRef FileName, bool IsAngled,
- CharSourceRange FilenameRange, const FileEntry *File,
- StringRef SearchPath, StringRef RelativePath,
- const Module *Imported) {
+ StringRef FileName, bool IsAngled,
+ CharSourceRange FilenameRange, const FileEntry *File,
+ StringRef SearchPath, StringRef RelativePath,
+ const Module *Imported) override {
Checker.collectUmbrellaHeaderHeader(File->getName());
}
@@ -129,7 +129,7 @@ public:
CoverageCheckerFrontendActionFactory(CoverageChecker &Checker)
: Checker(Checker) {}
- virtual CoverageCheckerAction *create() {
+ CoverageCheckerAction *create() override {
return new CoverageCheckerAction(Checker);
}
diff --git a/clang-tools-extra/modularize/Modularize.cpp b/clang-tools-extra/modularize/Modularize.cpp
index 38f1f1ac655..61234e0e5cf 100644
--- a/clang-tools-extra/modularize/Modularize.cpp
+++ b/clang-tools-extra/modularize/Modularize.cpp
@@ -631,9 +631,9 @@ public:
PPTracker.handlePreprocessorEntry(PP, InFile);
}
- ~CollectEntitiesConsumer() { PPTracker.handlePreprocessorExit(); }
+ ~CollectEntitiesConsumer() override { PPTracker.handlePreprocessorExit(); }
- virtual void HandleTranslationUnit(ASTContext &Ctx) {
+ void HandleTranslationUnit(ASTContext &Ctx) override {
SourceManager &SM = Ctx.getSourceManager();
// Collect declared entities.
@@ -691,7 +691,7 @@ public:
: Entities(Entities), PPTracker(preprocessorTracker),
HadErrors(HadErrors) {}
- virtual CollectEntitiesAction *create() {
+ CollectEntitiesAction *create() override {
return new CollectEntitiesAction(Entities, PPTracker, HadErrors);
}
diff --git a/clang-tools-extra/modularize/PreprocessorTracker.cpp b/clang-tools-extra/modularize/PreprocessorTracker.cpp
index c48f27e0e01..bc348c9c29e 100644
--- a/clang-tools-extra/modularize/PreprocessorTracker.cpp
+++ b/clang-tools-extra/modularize/PreprocessorTracker.cpp
@@ -747,7 +747,7 @@ public:
PreprocessorCallbacks(PreprocessorTrackerImpl &ppTracker,
clang::Preprocessor &PP, llvm::StringRef rootHeaderFile)
: PPTracker(ppTracker), PP(PP), RootHeaderFile(rootHeaderFile) {}
- ~PreprocessorCallbacks() {}
+ ~PreprocessorCallbacks() override {}
// Overridden handlers.
void InclusionDirective(clang::SourceLocation HashLoc,
@@ -757,24 +757,26 @@ public:
const clang::FileEntry *File,
llvm::StringRef SearchPath,
llvm::StringRef RelativePath,
- const clang::Module *Imported);
+ const clang::Module *Imported) override;
void FileChanged(clang::SourceLocation Loc,
clang::PPCallbacks::FileChangeReason Reason,
clang::SrcMgr::CharacteristicKind FileType,
- clang::FileID PrevFID = clang::FileID());
+ clang::FileID PrevFID = clang::FileID()) override;
void MacroExpands(const clang::Token &MacroNameTok,
const clang::MacroDirective *MD, clang::SourceRange Range,
- const clang::MacroArgs *Args);
+ const clang::MacroArgs *Args) override;
void Defined(const clang::Token &MacroNameTok,
- const clang::MacroDirective *MD, clang::SourceRange Range);
+ const clang::MacroDirective *MD,
+ clang::SourceRange Range) override;
void If(clang::SourceLocation Loc, clang::SourceRange ConditionRange,
- clang::PPCallbacks::ConditionValueKind ConditionResult);
+ clang::PPCallbacks::ConditionValueKind ConditionResult) override;
void Elif(clang::SourceLocation Loc, clang::SourceRange ConditionRange,
- clang::PPCallbacks::ConditionValueKind ConditionResult, clang::SourceLocation IfLoc);
+ clang::PPCallbacks::ConditionValueKind ConditionResult,
+ clang::SourceLocation IfLoc) override;
void Ifdef(clang::SourceLocation Loc, const clang::Token &MacroNameTok,
- const clang::MacroDirective *MD);
+ const clang::MacroDirective *MD) override;
void Ifndef(clang::SourceLocation Loc, const clang::Token &MacroNameTok,
- const clang::MacroDirective *MD);
+ const clang::MacroDirective *MD) override;
private:
PreprocessorTrackerImpl &PPTracker;
@@ -811,11 +813,11 @@ public:
}
}
- ~PreprocessorTrackerImpl() {}
+ ~PreprocessorTrackerImpl() override {}
// Handle entering a preprocessing session.
void handlePreprocessorEntry(clang::Preprocessor &PP,
- llvm::StringRef rootHeaderFile) {
+ llvm::StringRef rootHeaderFile) override {
HeadersInThisCompile.clear();
assert((HeaderStack.size() == 0) && "Header stack should be empty.");
pushHeaderHandle(addHeader(rootHeaderFile));
@@ -823,14 +825,15 @@ public:
rootHeaderFile));
}
// Handle exiting a preprocessing session.
- void handlePreprocessorExit() { HeaderStack.clear(); }
+ void handlePreprocessorExit() override { HeaderStack.clear(); }
// Handle include directive.
// This function is called every time an include directive is seen by the
// preprocessor, for the purpose of later checking for 'extern "" {}' or
// "namespace {}" blocks containing #include directives.
void handleIncludeDirective(llvm::StringRef DirectivePath, int DirectiveLine,
- int DirectiveColumn, llvm::StringRef TargetPath) {
+ int DirectiveColumn,
+ llvm::StringRef TargetPath) override {
// If it's not a header in the header list, ignore it with respect to
// the check.
if (BlockCheckHeaderListOnly && !isHeaderListHeader(TargetPath))
@@ -855,7 +858,7 @@ public:
bool checkForIncludesInBlock(clang::Preprocessor &PP,
clang::SourceRange BlockSourceRange,
const char *BlockIdentifierMessage,
- llvm::raw_ostream &OS) {
+ llvm::raw_ostream &OS) override {
clang::SourceLocation BlockStartLoc = BlockSourceRange.getBegin();
clang::SourceLocation BlockEndLoc = BlockSourceRange.getEnd();
// Use block location to get FileID of both the include directive
@@ -1139,7 +1142,7 @@ public:
// Report on inconsistent macro instances.
// Returns true if any mismatches.
- bool reportInconsistentMacros(llvm::raw_ostream &OS) {
+ bool reportInconsistentMacros(llvm::raw_ostream &OS) override {
bool ReturnValue = false;
// Walk all the macro expansion trackers in the map.
for (MacroExpansionMapIter I = MacroExpansions.begin(),
@@ -1200,7 +1203,7 @@ public:
// Report on inconsistent conditional instances.
// Returns true if any mismatches.
- bool reportInconsistentConditionals(llvm::raw_ostream &OS) {
+ bool reportInconsistentConditionals(llvm::raw_ostream &OS) override {
bool ReturnValue = false;
// Walk all the conditional trackers in the map.
for (ConditionalExpansionMapIter I = ConditionalExpansions.begin(),
OpenPOWER on IntegriCloud