[llvm-commits] [llvm-gcc-4.0] r41770 - /llvm-gcc-4.0/trunk/gcc/objc/objc-act.c
Devang Patel
dpatel at apple.com
Fri Sep 7 13:48:35 PDT 2007
Author: dpatel
Date: Fri Sep 7 15:48:34 2007
New Revision: 41770
URL: http://llvm.org/viewvc/llvm-project?rev=41770&view=rev
Log:
Do not drop _image_info section on the floor.
Modified:
llvm-gcc-4.0/trunk/gcc/objc/objc-act.c
Modified: llvm-gcc-4.0/trunk/gcc/objc/objc-act.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/objc/objc-act.c?rev=41770&r1=41769&r2=41770&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.0/trunk/gcc/objc/objc-act.c Fri Sep 7 15:48:34 2007
@@ -18267,10 +18267,22 @@
/* APPLE LOCAL end radar 4810609 */
/* APPLE LOCAL begin radar 4810587, radar 4964338 */
+ /* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+ /* Darwin linker prefers to use 'L' as a prefix. GCC codegen handles this
+ later while emitting symbols, but fix it here for llvm. */
+ decl = build_decl (VAR_DECL, get_identifier ("L_OBJC_IMAGE_INFO"),
+ build_array_type
+ (integer_type_node,
+ build_index_type (build_int_cst (NULL_TREE, 2 - 1))));
+#else
+ /* APPLE LOCAL end LLVM */
decl = build_decl (VAR_DECL, get_identifier ("_OBJC_IMAGE_INFO"),
build_array_type
(integer_type_node,
build_index_type (build_int_cst (NULL_TREE, 2 - 1))));
+ /* APPLE LOCAL LLVM */
+#endif
initlist = build_tree_list (NULL_TREE, build_int_cst (NULL_TREE, 0));
initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, flags), initlist);
initlist = objc_build_constructor (TREE_TYPE (decl), nreverse (initlist));
@@ -18285,6 +18297,13 @@
DECL_CONTEXT (decl) = 0;
DECL_ARTIFICIAL (decl) = 1;
DECL_INITIAL (decl) = initlist;
+ /* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+ /* Let optimizer know that this decl is not removable. */
+ set_user_assembler_name(decl, IDENTIFIER_POINTER (DECL_NAME(decl)));
+ DECL_PRESERVE_P (decl) = 1;
+#endif ENABLE_LLVM
+ /* APPLE LOCAL end LLVM */
assemble_variable (decl, 1, 0, 0);
}
/* APPLE LOCAL end radar 4810587, radar 4964338 */
More information about the llvm-commits
mailing list