Skip to content

Commit 415bfaf

Browse files
committed
BeginSourceFileAction/EndSourceFileAction invoke the base-class's method
An exception for this is the WrapperFrontendAction which cover this through the fowraded call to WrappedAction->BeginSourceFileAction/EndSourcefileAction
1 parent 1f60be5 commit 415bfaf

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

clang/lib/CodeGen/CodeGenAction.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,8 @@ bool CodeGenAction::loadLinkModules(CompilerInstance &CI) {
908908
bool CodeGenAction::hasIRSupport() const { return true; }
909909

910910
void CodeGenAction::EndSourceFileAction() {
911+
ASTFrontendAction::EndSourceFileAction();
912+
911913
// If the consumer creation failed, do nothing.
912914
if (!getCompilerInstance().hasASTConsumer())
913915
return;
@@ -932,7 +934,7 @@ CodeGenerator *CodeGenAction::getCodeGenerator() const {
932934
bool CodeGenAction::BeginSourceFileAction(CompilerInstance &CI) {
933935
if (CI.getFrontendOpts().GenReducedBMI)
934936
CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleInterface);
935-
return true;
937+
return ASTFrontendAction::BeginSourceFileAction(CI);
936938
}
937939

938940
static std::unique_ptr<raw_pwrite_stream>

clang/lib/Frontend/FrontendActions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ bool GeneratePCHAction::shouldEraseOutputFiles() {
182182

183183
bool GeneratePCHAction::BeginSourceFileAction(CompilerInstance &CI) {
184184
CI.getLangOpts().CompilingPCH = true;
185-
return true;
185+
return ASTFrontendAction::BeginSourceFileAction(CI);
186186
}
187187

188188
std::vector<std::unique_ptr<ASTConsumer>>

clang/lib/Frontend/Rewrite/FrontendActions.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,13 @@ bool FixItAction::BeginSourceFileAction(CompilerInstance &CI) {
104104
}
105105
Rewriter.reset(new FixItRewriter(CI.getDiagnostics(), CI.getSourceManager(),
106106
CI.getLangOpts(), FixItOpts.get()));
107-
return true;
107+
return ASTFrontendAction::BeginSourceFileAction(CI);
108108
}
109109

110110
void FixItAction::EndSourceFileAction() {
111111
// Otherwise rewrite all files.
112112
Rewriter->WriteFixedFiles();
113+
ASTFrontendAction::EndSourceFileAction();
113114
}
114115

115116
bool FixItRecompile::BeginInvocation(CompilerInstance &CI) {
@@ -299,7 +300,7 @@ bool RewriteIncludesAction::BeginSourceFileAction(CompilerInstance &CI) {
299300
std::make_unique<RewriteImportsListener>(CI, OutputStream));
300301
}
301302

302-
return true;
303+
return PreprocessorFrontendAction::BeginSourceFileAction(CI);
303304
}
304305

305306
void RewriteIncludesAction::ExecuteAction() {

0 commit comments

Comments
 (0)