]> granicus.if.org Git - clang/commitdiff
PR4133: fix always_inline implementation to be consistent with gcc.
authorEli Friedman <eli.friedman@gmail.com>
Sun, 3 May 2009 18:13:43 +0000 (18:13 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Sun, 3 May 2009 18:13:43 +0000 (18:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70786 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp
test/CodeGen/function-attributes.c

index 4e58d09360037a56d2c17ce58cdd82be39a434af..8de6ef5417093101b4c9fb8259f68721c3605cc4 100644 (file)
@@ -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<AlwaysInlineAttr>())
+  if (FD->getStorageClass() == FunctionDecl::Static)
     return CodeGenModule::GVA_Internal;
 
   if (!FD->isInline())
index 3269f98a56de3ea6460348a9fbe0b5a20da2ef0a..b1209766d8d02d14231e18f2cb1fda28dddb59bb 100644 (file)
@@ -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 &&