From c0042d804c8af643671fac709659945a3285dbbf Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Sun, 3 May 2009 18:13:43 +0000 Subject: [PATCH] PR4133: fix always_inline implementation to be consistent with gcc. llvm-svn: 70786 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 +-- clang/test/CodeGen/function-attributes.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 4e58d0936003..8de6ef541709 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -231,8 +231,7 @@ void CodeGenModule::EmitAnnotations() { static CodeGenModule::GVALinkage GetLinkageForFunction(const FunctionDecl *FD, const LangOptions &Features) { // "static" and attr(always_inline) functions get internal linkage. - if (FD->getStorageClass() == FunctionDecl::Static || - FD->hasAttr()) + if (FD->getStorageClass() == FunctionDecl::Static) return CodeGenModule::GVA_Internal; if (!FD->isInline()) diff --git a/clang/test/CodeGen/function-attributes.c b/clang/test/CodeGen/function-attributes.c index 3269f98a56de..b1209766d8d0 100644 --- a/clang/test/CodeGen/function-attributes.c +++ b/clang/test/CodeGen/function-attributes.c @@ -24,8 +24,7 @@ void f6(signed short x) { } void f7(unsigned short x) { } -// F8 is dead so it should not be emitted. -// RUN: not grep '@f8' %t && +// RUN: grep 'define void @f8() nounwind alwaysinline' %t && void __attribute__((always_inline)) f8(void) { } // RUN: grep 'call void @f9_t() noreturn' %t &&