aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp5
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp15
2 files changed, 5 insertions, 15 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 8900faf..e87226e 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -969,10 +969,9 @@ CodeGenerator *CodeGenAction::getCodeGenerator() const {
return BEConsumer->getCodeGenerator();
}
-bool CodeGenAction::BeginInvocation(CompilerInstance &CI) {
+bool CodeGenAction::BeginSourceFileAction(CompilerInstance &CI) {
if (CI.getFrontendOpts().GenReducedBMI)
- return BeginInvocationForModules(CI);
-
+ CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleInterface);
return true;
}
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 8c7b749..9f5d09e 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -262,20 +262,11 @@ GenerateModuleFromModuleMapAction::CreateOutputFile(CompilerInstance &CI,
/*ForceUseTemporary=*/true);
}
-bool clang::BeginInvocationForModules(CompilerInstance &CI) {
- // Embed all module files for named modules.
- // See https://github.com/llvm/llvm-project/issues/72383 for discussion.
- CI.getFrontendOpts().ModulesEmbedAllFiles = true;
- CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleInterface);
- return true;
-}
-
-bool GenerateModuleInterfaceAction::BeginInvocation(
+bool GenerateModuleInterfaceAction::BeginSourceFileAction(
CompilerInstance &CI) {
- if (!BeginInvocationForModules(CI))
- return false;
+ CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleInterface);
- return GenerateModuleAction::BeginInvocation(CI);
+ return GenerateModuleAction::BeginSourceFileAction(CI);
}
std::unique_ptr<ASTConsumer>