aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaModule.cpp
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2023-02-13 17:12:20 +0800
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>2023-02-13 17:14:58 +0800
commit24ecd99842352ed1e6d7877e76e93c2f83ebf3f3 (patch)
treee047fabd245c876e1c7ea5c867c9503b5c4865e7 /clang/lib/Sema/SemaModule.cpp
parent19659b5f0dd1a1dcf745cf058d042ada2d4ff061 (diff)
downloadllvm-24ecd99842352ed1e6d7877e76e93c2f83ebf3f3.zip
llvm-24ecd99842352ed1e6d7877e76e93c2f83ebf3f3.tar.gz
llvm-24ecd99842352ed1e6d7877e76e93c2f83ebf3f3.tar.bz2
[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.
Diffstat (limited to 'clang/lib/Sema/SemaModule.cpp')
-rw-r--r--clang/lib/Sema/SemaModule.cpp2
1 files changed, 2 insertions, 0 deletions
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;
}