[llvm-commits] [llvm-gcc-4.2] r41883 - in /llvm-gcc-4.2/trunk/gcc: config/darwin.h varasm.c

Bill Wendling isanbard at gmail.com
Wed Sep 12 12:00:04 PDT 2007


Author: void
Date: Wed Sep 12 13:59:44 2007
New Revision: 41883

URL: http://llvm.org/viewvc/llvm-project?rev=41883&view=rev
Log:
Port of r41882: 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.2/trunk/gcc/config/darwin.h
    llvm-gcc-4.2/trunk/gcc/varasm.c

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=41883&r1=41882&r2=41883&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Wed Sep 12 13:59:44 2007
@@ -583,6 +583,9 @@
   } while (0)
 
 /* LLVM LOCAL begin */
+/* 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.2/trunk/gcc/varasm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/varasm.c?rev=41883&r1=41882&r2=41883&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/varasm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/varasm.c Wed Sep 12 13:59:44 2007
@@ -5177,7 +5177,12 @@
         }
               
       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);
@@ -5260,7 +5265,11 @@
   target_decl = find_decl_and_mark_needed (decl, target);
   if (target_decl && TREE_ASM_WRITTEN (target_decl))
 #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
+      emit_alias_to_llvm(decl, target, target_decl);
+#endif
 #else
   do_assemble_alias (decl, target);
 #endif





More information about the llvm-commits mailing list