From aa2741449c3609b2ae244d8d3f3e14ad16de72e4 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 15 Apr 2024 16:56:44 +0800 Subject: 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. --- clang/lib/CodeGen/CodeGenModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 73a9cb9d6e04..e44749672d58 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()) return false; if (F->hasAttr()) -- cgit v1.2.3