From 2eeeff842f993a694159183a2834b4d305549cad Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 29 Aug 2024 16:06:03 +0800 Subject: [C++20] [Modules] Embed all source files for C++20 Modules (#102444) Close https://github.com/llvm/llvm-project/issues/72383 The implementation rationale is, I don't want to pass `-fmodules-embed-all-files` all the time since we can't test it in lit tests (we're using `clang_cc1`). So I tried to set it in FrontendActions for modules. --- clang/lib/CodeGen/CodeGenAction.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenAction.cpp') diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index e87226e..8900faf 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -969,9 +969,10 @@ CodeGenerator *CodeGenAction::getCodeGenerator() const { return BEConsumer->getCodeGenerator(); } -bool CodeGenAction::BeginSourceFileAction(CompilerInstance &CI) { +bool CodeGenAction::BeginInvocation(CompilerInstance &CI) { if (CI.getFrontendOpts().GenReducedBMI) - CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleInterface); + return BeginInvocationForModules(CI); + return true; } -- cgit v1.1