[llvm-commits] [llvm-gcc-4.2] r73088 - /llvm-gcc-4.2/trunk/gcc/config/darwin.h
Dale Johannesen
dalej at apple.com
Mon Jun 8 15:17:27 PDT 2009
Author: johannes
Date: Mon Jun 8 17:17:26 2009
New Revision: 73088
URL: http://llvm.org/viewvc/llvm-project?rev=73088&view=rev
Log:
Weak imports on Darwin do not apply to data definitions.
Modified:
llvm-gcc-4.2/trunk/gcc/config/darwin.h
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=73088&r1=73087&r2=73088&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Mon Jun 8 17:17:26 2009
@@ -662,18 +662,19 @@
/* As in the warning above, alias definitions aren't supported on Mach-O. */
#define TARGET_DOES_NOT_SUPPORT_ALIAS_DEFINITIONS
-/* weak_import, a Darwin special, does not make function definitions weak. */
+/* weak_import, a Darwin special, does not make definitions weak. */
#define TARGET_ADJUST_LLVM_LINKAGE(FN, DECL) \
do { \
if ((DECL) && \
- TREE_CODE (DECL) == FUNCTION_DECL && \
- !DECL_EXTERNAL (DECL) && \
+ (TREE_CODE (DECL) != FUNCTION_DECL || !DECL_EXTERNAL (DECL)) && \
TREE_PUBLIC (DECL) && \
DECL_WEAK (DECL) && \
! lookup_attribute ("weak", DECL_ATTRIBUTES (DECL)) && \
lookup_attribute ("weak_import", DECL_ATTRIBUTES (DECL)) && \
(FN)->hasWeakLinkage()) { \
- (FN)->setLinkage(Function::ExternalLinkage); \
+ (FN)->setLinkage(TREE_CODE(DECL)==FUNCTION_DECL ? \
+ Function::ExternalLinkage : \
+ GlobalValue::ExternalLinkage); \
} \
} while (0)
More information about the llvm-commits
mailing list