From 24ecd99842352ed1e6d7877e76e93c2f83ebf3f3 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 13 Feb 2023 17:12:20 +0800 Subject: [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. --- clang/lib/Sema/SemaModule.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Sema/SemaModule.cpp') diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp index 194239a..8f38dc8 100644 --- a/clang/lib/Sema/SemaModule.cpp +++ b/clang/lib/Sema/SemaModule.cpp @@ -409,6 +409,8 @@ Sema::ActOnModuleDecl(SourceLocation StartLoc, SourceLocation ModuleLoc, return ConvertDeclToDeclGroup(Import); } + getASTContext().setNamedModuleForCodeGen(Mod); + // FIXME: Create a ModuleDecl. return nullptr; } -- cgit v1.1