Skip to content

Commit a41a20b

Browse files
committed
[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 #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.
1 parent 12c85cd commit a41a20b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/lib/Frontend/FrontendActions.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,6 @@ std::unique_ptr<ASTConsumer>
273273
GenerateModuleInterfaceAction::CreateASTConsumer(CompilerInstance &CI,
274274
StringRef InFile) {
275275
std::vector<std::unique_ptr<ASTConsumer>> Consumers;
276-
Consumers.push_back(std::make_unique<CXX20ModulesGenerator>(
277-
CI.getPreprocessor(), CI.getModuleCache(),
278-
CI.getFrontendOpts().OutputFile));
279276

280277
if (CI.getFrontendOpts().GenReducedBMI &&
281278
!CI.getFrontendOpts().ModuleOutputPath.empty()) {
@@ -284,6 +281,10 @@ GenerateModuleInterfaceAction::CreateASTConsumer(CompilerInstance &CI,
284281
CI.getFrontendOpts().ModuleOutputPath));
285282
}
286283

284+
Consumers.push_back(std::make_unique<CXX20ModulesGenerator>(
285+
CI.getPreprocessor(), CI.getModuleCache(),
286+
CI.getFrontendOpts().OutputFile));
287+
287288
return std::make_unique<MultiplexConsumer>(std::move(Consumers));
288289
}
289290

0 commit comments

Comments
 (0)