aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2023-11-09 17:15:55 +0800
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>2023-11-09 17:44:41 +0800
commit0f7aaeb3241c3803489a45753190e82dbc7fd5fa (patch)
tree241536efd4dd2fece6917eaeb4bbfd56056c776c /clang/lib/CodeGen/CodeGenModule.cpp
parente3d750cc40e4cea281924142859dd4b9a6465f99 (diff)
downloadllvm-0f7aaeb3241c3803489a45753190e82dbc7fd5fa.zip
llvm-0f7aaeb3241c3803489a45753190e82dbc7fd5fa.tar.gz
llvm-0f7aaeb3241c3803489a45753190e82dbc7fd5fa.tar.bz2
[C++20] [Modules] Allow export from language linkage
Close https://github.com/llvm/llvm-project/issues/71347 Previously I misread the concept of module purview. I thought if a declaration attached to a unnamed module, it can't be part of the module purview. But after the issue report, I recognized that module purview is more of a concept about locations instead of semantics. Concretely, the things in the language linkage after module declarations can be exported. This patch refactors `Module::isModulePurview()` and introduces some possible code cleanups.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 2e96fff..7535528 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3859,7 +3859,7 @@ bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) {
// We don't import function bodies from other named module units since that
// behavior may break ABI compatibility of the current unit.
if (const Module *M = F->getOwningModule();
- M && M->isModulePurview() &&
+ M && M->getTopLevelModule()->isNamedModule() &&
getContext().getCurrentNamedModule() != M->getTopLevelModule() &&
!F->hasAttr<AlwaysInlineAttr>())
return false;