Skip to content

Commit df8c331

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 f447054 commit df8c331

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
@@ -181,7 +181,7 @@ bool GeneratePCHAction::shouldEraseOutputFiles() {
181181

182182
bool GeneratePCHAction::BeginSourceFileAction(CompilerInstance &CI) {
183183
CI.getLangOpts().CompilingPCH = true;
184-
return true;
184+
return ASTFrontendAction::BeginSourceFileAction(CI);
185185
}
186186

187187
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
@@ -103,12 +103,13 @@ bool FixItAction::BeginSourceFileAction(CompilerInstance &CI) {
103103
}
104104
Rewriter.reset(new FixItRewriter(CI.getDiagnostics(), CI.getSourceManager(),
105105
CI.getLangOpts(), FixItOpts.get()));
106-
return true;
106+
return ASTFrontendAction::BeginSourceFileAction(CI);
107107
}
108108

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

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

301-
return true;
302+
return PreprocessorFrontendAction::BeginSourceFileAction(CI);
302303
}
303304

304305
void RewriteIncludesAction::ExecuteAction() {

0 commit comments

Comments
 (0)