[llvm-commits] [llvm-gcc-4.2] r62393 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp testsuite/gcc.target/i386/mmx-c99.c
Dale Johannesen
dalej at apple.com
Fri Jan 16 17:38:39 PST 2009
Author: johannes
Date: Fri Jan 16 19:38:39 2009
New Revision: 62393
URL: http://llvm.org/viewvc/llvm-project?rev=62393&view=rev
Log:
Make sure "inline always-inline" functions in C99
don't get emitted to the output file.
(Equivalent to "extern inline always-inline" in
C89, a gcc extension with is incompatible with C99.)
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/mmx-c99.c
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=62393&r1=62392&r2=62393&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Jan 16 19:38:39 2009
@@ -638,8 +638,15 @@
assert(Fn->empty() && "Function expanded multiple times!");
// Compute the linkage that the function should get.
+ // Functions declared "always inline" should not have a body
+ // emitted; hack this by pretending they're static. That will either
+ // make them go away or emit a static definition that won't collide with
+ // anything.
if (!TREE_PUBLIC(FnDecl) /*|| lang_hooks.llvm_is_in_anon(subr)*/) {
Fn->setLinkage(Function::InternalLinkage);
+ } else if (DECL_EXTERNAL(FnDecl) &&
+ lookup_attribute ("always_inline", DECL_ATTRIBUTES (FnDecl))) {
+ Fn->setLinkage(Function::InternalLinkage);
} else if (DECL_COMDAT(FnDecl)) {
Fn->setLinkage(Function::LinkOnceLinkage);
} else if (DECL_WEAK(FnDecl) || DECL_ONE_ONLY(FnDecl)) {
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/mmx-c99.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/mmx-c99.c?rev=62393&r1=62392&r2=62393&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/mmx-c99.c (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/mmx-c99.c Fri Jan 16 19:38:39 2009
@@ -9,3 +9,4 @@
return _mm_loadu_ps(&A[4]);
}
/* { dg-final { scan-assembler-not "call" } } */
+/* { dg-final { scan-assembler-not "mm_" } } */
More information about the llvm-commits
mailing list