aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2024-06-03 15:44:04 +0800
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>2024-06-03 15:47:34 +0800
commita41a20bd47968b16bb84761578628752080e9f24 (patch)
treefe830ce1301ccb53d84fba4edadf04f133a0550f
parent12c85cd31088f64a1afbc5b2133dde2e1d2516d3 (diff)
downloadllvm-a41a20bd47968b16bb84761578628752080e9f24.zip
llvm-a41a20bd47968b16bb84761578628752080e9f24.tar.gz
llvm-a41a20bd47968b16bb84761578628752080e9f24.tar.bz2
[NFC] [C++20] [Modules] [Reduced BMI] Reorder Emitting reduced BMI and normal BMI for named modules
When we generate the reduced BMI on the fly, the order of the emitting phase is different within `-emit-obj` and `-emit-module-interface`. Although this is meant to be fine, we observed it in https://github.com/llvm/llvm-project/issues/93859 (that the different phase order may cause problems). Also it turns out to be a different fundamental reason to the orders. But it might be fine to make the order of emitting reducing BMI at first to avoid such confusions in the future.
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 454653a..4f06432 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -273,9 +273,6 @@ std::unique_ptr<ASTConsumer>
GenerateModuleInterfaceAction::CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) {
std::vector<std::unique_ptr<ASTConsumer>> Consumers;
- Consumers.push_back(std::make_unique<CXX20ModulesGenerator>(
- CI.getPreprocessor(), CI.getModuleCache(),
- CI.getFrontendOpts().OutputFile));
if (CI.getFrontendOpts().GenReducedBMI &&
!CI.getFrontendOpts().ModuleOutputPath.empty()) {
@@ -284,6 +281,10 @@ GenerateModuleInterfaceAction::CreateASTConsumer(CompilerInstance &CI,
CI.getFrontendOpts().ModuleOutputPath));
}
+ Consumers.push_back(std::make_unique<CXX20ModulesGenerator>(
+ CI.getPreprocessor(), CI.getModuleCache(),
+ CI.getFrontendOpts().OutputFile));
+
return std::make_unique<MultiplexConsumer>(std::move(Consumers));
}