aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Module.cpp
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2023-09-28 23:29:24 +0800
committerGitHub <noreply@github.com>2023-09-28 23:29:24 +0800
commit989173c09c2930a9f523ccb455111ef446e9f96d (patch)
tree1265a7ed5341a2c94fa9e045c144e115d157d764 /clang/lib/Basic/Module.cpp
parente0a48c065b0332c6a76df6a6d5642e8e8ebb6f91 (diff)
downloadllvm-989173c09c2930a9f523ccb455111ef446e9f96d.zip
llvm-989173c09c2930a9f523ccb455111ef446e9f96d.tar.gz
llvm-989173c09c2930a9f523ccb455111ef446e9f96d.tar.bz2
[C++20] [Modules] Don't generate call to an imported module that dont init anything (#67638)
Close https://github.com/llvm/llvm-project/issues/56794 And see https://github.com/llvm/llvm-project/issues/67582 for a detailed backgrond for the issue. As required by the Itanium ABI, the module units have to generate the initialization function. However, the importers are allowed to elide the call to the initialization function if they are sure the initialization function doesn't do anything. This patch implemented this semantics.
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r--clang/lib/Basic/Module.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index 4e6fbfc..23683ea 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -44,7 +44,7 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,
InferSubmodules(false), InferExplicitSubmodules(false),
InferExportWildcard(false), ConfigMacrosExhaustive(false),
NoUndeclaredIncludes(false), ModuleMapIsPrivate(false),
- NameVisibility(Hidden) {
+ NamedModuleHasNoInit(false), NameVisibility(Hidden) {
if (Parent) {
IsAvailable = Parent->isAvailable();
IsUnimportable = Parent->isUnimportable();