diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-02-18 15:08:02 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-02-18 15:15:28 +0800 |
commit | 1ecbab56dcbb78268c8d19af34a50591f90b12a0 (patch) | |
tree | 6d8f4d0681c557210f328f5f6ea81ead2f1d089d /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | ead0a9777f8ccb5c26d50d96bade6cd5b47f496b (diff) | |
download | llvm-1ecbab56dcbb78268c8d19af34a50591f90b12a0.zip llvm-1ecbab56dcbb78268c8d19af34a50591f90b12a0.tar.gz llvm-1ecbab56dcbb78268c8d19af34a50591f90b12a0.tar.bz2 |
[C++20] [Modules] Don't import non-inline function bodies even if it is marked as always_inline
Close https://github.com/llvm/llvm-project/issues/80949
Previously, I thought the always-inline function can be an exception to
enable optimizations as much as possible. However, it looks like it
breaks the ABI requirement we discussed later. So it looks better to not
import non-inline function bodies at all even if the function bodies are
marked as always_inline.
It doesn't produce regressions in some degree since the always_inline
still works in the same TU.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c984260..836cd34 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3985,8 +3985,7 @@ 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() && - !F->hasAttr<AlwaysInlineAttr>()) + getContext().getCurrentNamedModule() != M->getTopLevelModule()) return false; if (F->hasAttr<NoInlineAttr>()) |