diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-04-15 16:56:44 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-04-15 17:06:03 +0800 |
commit | aa2741449c3609b2ae244d8d3f3e14ad16de72e4 (patch) | |
tree | 425d339827311ec57426ffc93b479703313b643f /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 2347020e4ce62ee7c7378824dc6ad2b94917a638 (diff) | |
download | llvm-aa2741449c3609b2ae244d8d3f3e14ad16de72e4.zip llvm-aa2741449c3609b2ae244d8d3f3e14ad16de72e4.tar.gz llvm-aa2741449c3609b2ae244d8d3f3e14ad16de72e4.tar.bz2 |
Revert "[C++20] [Modules] Don't import non-inline function bodies even if it is marked as always_inline"
This reverts commit 1ecbab56dcbb78268c8d19af34a50591f90b12a0.
See the discussion in https://github.com/llvm/llvm-project/issues/86893.
The original commit receives too many complaints. Let's try to
workaround the issue to give better user experiences.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 73a9cb9..e447496 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3952,7 +3952,8 @@ bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) { // behavior may break ABI compatibility of the current unit. if (const Module *M = F->getOwningModule(); M && M->getTopLevelModule()->isNamedModule() && - getContext().getCurrentNamedModule() != M->getTopLevelModule()) + getContext().getCurrentNamedModule() != M->getTopLevelModule() && + !F->hasAttr<AlwaysInlineAttr>()) return false; if (F->hasAttr<NoInlineAttr>()) |