[llvm-commits] [126022] fix linkage of weak/linkonce functions

johannes at apple.com johannes at apple.com
Thu Apr 12 13:54:25 PDT 2007


Revision: 126022
Author:   johannes
Date:     2007-04-12 13:54:24 -0700 (Thu, 12 Apr 2007)

Log Message:
-----------
fix linkage of weak/linkonce functions

Modified Paths:
--------------
    apple-local/branches/llvm/gcc/llvm-convert.cpp

Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-04-12 19:07:05 UTC (rev 126021)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-04-12 20:54:24 UTC (rev 126022)
@@ -495,16 +495,10 @@
   // Compute the linkage that the function should get.
   if (!TREE_PUBLIC(FnDecl) /*|| lang_hooks.llvm_is_in_anon(subr)*/) {
     Fn->setLinkage(Function::InternalLinkage);
-  } else if (DECL_DECLARED_INLINE_P(FnDecl)) {
-    if (DECL_EXTERNAL(FnDecl)) {
-      Fn->setLinkage(Function::LinkOnceLinkage);
-    } else {
-      Fn->setLinkage(Function::WeakLinkage);
-    }
-  } else if (DECL_WEAK(FnDecl) || DECL_ONE_ONLY(FnDecl)) {
-    Fn->setLinkage(Function::WeakLinkage);
   } else if (DECL_COMDAT(FnDecl)) {
     Fn->setLinkage(Function::LinkOnceLinkage);
+  } else if (DECL_WEAK(FnDecl) || DECL_ONE_ONLY(FnDecl)) {
+    Fn->setLinkage(Function::WeakLinkage);
   }
 
 #ifdef TARGET_ADJUST_LLVM_LINKAGE





More information about the llvm-commits mailing list