[NFC] Set C++20 Named Modules for CodeGen in ASTContext in the early place

Previously we'll set the named modules for ASTContext in ParseAST. But
this is not intuitive and we need comments to tell the intuition. This
patch moves the code the right the place, where the corrresponding
module is first created/loaded. Now it is more intuitive and we can use
the value in the earlier places.
This commit is contained in:
Chuanqi Xu
2023-02-13 17:12:20 +08:00
parent 19659b5f0d
commit 24ecd99842
6 changed files with 14 additions and 28 deletions

View File

@@ -509,7 +509,7 @@ static void setVisibilityFromDLLStorageClass(const clang::LangOptions &LO,
}
void CodeGenModule::Release() {
Module *Primary = getContext().getModuleForCodeGen();
Module *Primary = getContext().getNamedModuleForCodeGen();
if (CXX20ModuleInits && Primary && !Primary->isHeaderLikeModule())
EmitModuleInitializers(Primary);
EmitDeferred();