diff options
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendActions.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index 9f5d09e..8c7b749 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -262,11 +262,20 @@ GenerateModuleFromModuleMapAction::CreateOutputFile(CompilerInstance &CI, /*ForceUseTemporary=*/true); } -bool GenerateModuleInterfaceAction::BeginSourceFileAction( - CompilerInstance &CI) { +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; +} - return GenerateModuleAction::BeginSourceFileAction(CI); +bool GenerateModuleInterfaceAction::BeginInvocation( + CompilerInstance &CI) { + if (!BeginInvocationForModules(CI)) + return false; + + return GenerateModuleAction::BeginInvocation(CI); } std::unique_ptr<ASTConsumer> |