aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2022-06-03 10:43:38 +0100
committerIain Sandoe <iain@sandoe.co.uk>2023-03-29 08:52:28 +0530
commit6e4f870a21e344fdcd61fe613b0aeeafb8a84ed2 (patch)
treea6e16ee5cb1e7c71a5ab467dac93617bb1731535 /clang/lib/CodeGen/CodeGenModule.cpp
parent279c7a2f17937836ed13e359c3fb381bef7defaf (diff)
downloadllvm-6e4f870a21e344fdcd61fe613b0aeeafb8a84ed2.zip
llvm-6e4f870a21e344fdcd61fe613b0aeeafb8a84ed2.tar.gz
llvm-6e4f870a21e344fdcd61fe613b0aeeafb8a84ed2.tar.bz2
re-land [C++20][Modules] Introduce an implementation module.
We need to be able to distinguish individual TUs from the same module in cases where TU-local entities either need to be hidden (or, for some cases of ADL in template instantiation, need to be detected as exposures). This creates a module type for the implementation which implicitly imports its primary module interface per C++20: [module.unit/8] 'A module-declaration that contains neither an export-keyword nor a module-partition implicitly imports the primary module interface unit of the module as if by a module-import-declaration. Implementation modules are never serialized (-emit-module-interface for an implementation unit is diagnosed and rejected). Differential Revision: https://reviews.llvm.org/D126959
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 0e33e96..bd1ee2a 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -548,6 +548,8 @@ void CodeGenModule::Release() {
GlobalTopLevelStmtBlockInFlight = {nullptr, nullptr};
}
+ // Module implementations are initialized the same way as a regular TU that
+ // imports one or more modules.
if (CXX20ModuleInits && Primary && Primary->isInterfaceOrPartition())
EmitCXXModuleInitFunc(Primary);
else