[llvm-commits] [llvm-gcc-4.0] r41882 - in /llvm-gcc-4.0/trunk/gcc: config/darwin.h llvm-backend.cpp varasm.c
Bill Wendling
isanbard at gmail.com
Wed Sep 12 11:55:14 PDT 2007
Author: void
Date: Wed Sep 12 13:55:13 2007
New Revision: 41882
URL: http://llvm.org/viewvc/llvm-project?rev=41882&view=rev
Log:
Alias definitions aren't supported on some platforms. Create a flag (TARGET_DOES_NOT_SUPPORT_ALIAS_DEFINITIONS) that indicates this and stops us from creating aliases.
Modified:
llvm-gcc-4.0/trunk/gcc/config/darwin.h
llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.0/trunk/gcc/varasm.c
Modified: llvm-gcc-4.0/trunk/gcc/config/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/config/darwin.h?rev=41882&r1=41881&r2=41882&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/config/darwin.h (original)
+++ llvm-gcc-4.0/trunk/gcc/config/darwin.h Wed Sep 12 13:55:13 2007
@@ -674,6 +674,9 @@
} while (0)
/* APPLE LOCAL begin LLVM */
+/* 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. */
#define TARGET_ADJUST_LLVM_LINKAGE(FN, DECL) \
do { \
Modified: llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp?rev=41882&r1=41881&r2=41882&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp Wed Sep 12 13:55:13 2007
@@ -677,7 +677,7 @@
else if (Function *F = dyn_cast<Function>(V))
F->eraseFromParent();
else
- assert(0 && "Unsuported global value");
+ assert(0 && "Unsupported global value");
TREE_ASM_WRITTEN(decl) = 1;
Modified: llvm-gcc-4.0/trunk/gcc/varasm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/varasm.c?rev=41882&r1=41881&r2=41882&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/varasm.c (original)
+++ llvm-gcc-4.0/trunk/gcc/varasm.c Wed Sep 12 13:55:13 2007
@@ -4762,7 +4762,12 @@
{
tree target_decl;
target_decl = find_decl_and_mark_needed (p->decl, p->target);
+#ifdef TARGET_DOES_NOT_SUPPORT_ALIAS_DEFINITIONS
+ if (target_decl)
+ warning ("%Jalias definitions not supported; ignored", target_decl);
+#else
emit_alias_to_llvm(p->decl, p->target, target_decl);
+#endif
}
#else
do_assemble_alias (p->decl, p->target);
@@ -4819,11 +4824,19 @@
alias. This saves a tad o memory. */
target_decl = find_decl_and_mark_needed (decl, target);
if (target_decl && TREE_ASM_WRITTEN (target_decl))
+ /* APPLE LOCAL begin LLVM */
+ {
#ifdef ENABLE_LLVM
- emit_alias_to_llvm(decl, target, target_decl);
+#ifdef TARGET_DOES_NOT_SUPPORT_ALIAS_DEFINITIONS
+ warning ("%Jalias definitions not supported; ignored", target_decl);
#else
- do_assemble_alias (decl, target);
+ emit_alias_to_llvm(decl, target, target_decl);
#endif
+#else
+ do_assemble_alias (decl, target);
+#endif
+ }
+ /* APPLE LOCAL end LLVM */
else
{
alias_pair p;
More information about the llvm-commits
mailing list