[llvm-commits] [llvm-gcc-4.2] r54177 - in /llvm-gcc-4.2/trunk: driverdriver.c gcc/optabs.c gcc/reload1.c gcc/tree.c

Bill Wendling isanbard at gmail.com
Tue Jul 29 15:46:07 PDT 2008


Author: void
Date: Tue Jul 29 17:46:06 2008
New Revision: 54177

URL: http://llvm.org/viewvc/llvm-project?rev=54177&view=rev
Log:
More merging to Apple's GCC 4.2

Modified:
    llvm-gcc-4.2/trunk/driverdriver.c
    llvm-gcc-4.2/trunk/gcc/optabs.c
    llvm-gcc-4.2/trunk/gcc/reload1.c
    llvm-gcc-4.2/trunk/gcc/tree.c

Modified: llvm-gcc-4.2/trunk/driverdriver.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/driverdriver.c?rev=54177&r1=54176&r2=54177&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/driverdriver.c (original)
+++ llvm-gcc-4.2/trunk/driverdriver.c Tue Jul 29 17:46:06 2008
@@ -120,6 +120,11 @@
   {"ppc", "powerpc"},
   {"ppc64", "powerpc"},
   {"x86_64", "i686"},
+  {"arm", "arm"},
+  {"armv4t", "arm"},
+  {"armv5", "arm"},
+  {"xscale", "arm"},
+  {"armv6", "arm"},
   {NULL, NULL}
 };
 
@@ -754,6 +759,16 @@
     current_argv[arch_index] = "-march=pentium2";
   else if (!strcmp (arches[index], "x86_64"))
     current_argv[arch_index] = "-m64";
+  else if (!strcmp (arches[index], "arm"))
+    current_argv[arch_index] = "-march=armv4t";
+  else if (!strcmp (arches[index], "armv4t"))
+    current_argv[arch_index] = "-march=armv4t";
+  else if (!strcmp (arches[index], "armv5"))
+    current_argv[arch_index] = "-march=armv5tej";
+  else if (!strcmp (arches[index], "xscale"))
+    current_argv[arch_index] = "-march=xscale";
+  else if (!strcmp (arches[index], "armv6"))
+    current_argv[arch_index] = "-march=armv6k";
   else
     count = 0;
 
@@ -1251,7 +1266,6 @@
   char *override_option_str = NULL;
   char path_buffer[2*PATH_MAX+1];
   int linklen;
-  int delete_prefix = 0;
 
   total_argc = argc;
   prog_len = 0;
@@ -1307,26 +1321,7 @@
   curr_dir = (char *) malloc (sizeof (char) * (prefix_len + 1));
   strncpy (curr_dir, argv[0], prefix_len);
   curr_dir[prefix_len] = '\0';
-  /* LLVM LOCAL begin - These drivers live in /.../usr/llvm-gcc-4.2/bin */
-#if 0
-  {
-    size_t curr_dir_len = strlen (curr_dir);
-    const char *llvm_bin_dir = "/usr/llvm-gcc-4.2/bin/";
-    size_t bin_dir_len = strlen (llvm_bin_dir);
-
-    if (curr_dir_len <= bin_dir_len ||
-        strncmp (&curr_dir[curr_dir_len - bin_dir_len], llvm_bin_dir, bin_dir_len) != 0) {
-      driver_exec_prefix =
-        make_relative_prefix (argv[0], curr_dir, "/usr/llvm-gcc-4.2/bin/");
-      delete_prefix = 1;
-      prefix_len = strlen (driver_exec_prefix);
-    } else
-      driver_exec_prefix = curr_dir;
-  }
-#else
-  driver_exec_prefix = curr_dir;
-#endif
-  /* LLVM LOCAL end - These drivers live in /.../usr/llvm-gcc-4.2/bin */
+  driver_exec_prefix = (argv[0], "/usr/bin", curr_dir);
 
 #ifdef DEBUG
   fprintf (stderr,"%s: full progname = %s\n", progname, argv[0]);
@@ -1628,11 +1623,5 @@
 
   final_cleanup ();
   free (curr_dir);
-  /* LLVM LOCAL - begin */
-#if 0
-  if (delete_prefix)
-    free (driver_exec_prefix);
-#endif
-  /* LLVM LOCAL - end */
   return greatest_status;
 }

Modified: llvm-gcc-4.2/trunk/gcc/optabs.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/optabs.c?rev=54177&r1=54176&r2=54177&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/optabs.c (original)
+++ llvm-gcc-4.2/trunk/gcc/optabs.c Tue Jul 29 17:46:06 2008
@@ -59,7 +59,9 @@
 
 rtx libfunc_table[LTI_MAX];
 /* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
 tree llvm_libfunc_table[LTI_MAX];
+#endif
 /* LLVM LOCAL end */
 
 /* Tables of patterns for converting one mode to another.  */
@@ -5136,7 +5138,7 @@
 }
 
 
-/* LLVM local begin */
+/* LLVM LOCAL begin */
 tree
 llvm_init_one_libfunc_impl (const char *name)
 {
@@ -5144,25 +5146,22 @@
      targetm.encode_section_info.  */
   /* ??? We don't have any type information except for this is
      a function.  Pretend this is "int foo()".  */
-  tree decl;
-
-  decl = build_decl (FUNCTION_DECL, get_identifier (name),
-                     build_function_type (integer_type_node, NULL_TREE));
-
+  tree decl = build_decl (FUNCTION_DECL, get_identifier (name),
+			  build_function_type (integer_type_node, NULL_TREE));
   DECL_ARTIFICIAL (decl) = 1;
   DECL_EXTERNAL (decl) = 1;
   TREE_PUBLIC (decl) = 1;
 
   return decl;
 }
+/* LLVM LOCAL end */
 
-/* LLVM local end */
 rtx
 init_one_libfunc (const char *name)
 {
   rtx symbol;
 
-  /* LLVM local begin */
+  /* LLVM LOCAL begin */
   tree decl;
 
 #ifdef ENABLE_LLVM
@@ -5170,7 +5169,7 @@
 #endif
 
   decl = llvm_init_one_libfunc_impl (name);
-  /* LLVM local end */
+  /* LLVM LOCAL end */
 
   symbol = XEXP (DECL_RTL (decl), 0);
 

Modified: llvm-gcc-4.2/trunk/gcc/reload1.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/reload1.c?rev=54177&r1=54176&r2=54177&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/reload1.c (original)
+++ llvm-gcc-4.2/trunk/gcc/reload1.c Tue Jul 29 17:46:06 2008
@@ -1797,6 +1797,21 @@
 	      /* Among registers with equal cost, prefer caller-saved ones, or
 		 use REG_ALLOC_ORDER if it is defined.  */
 	      || (this_cost == best_cost
+/* APPLE LOCAL begin 5831562 add DIMODE_REG_ALLOC_ORDER */
+#ifdef DIMODE_REG_ALLOC_ORDER
+		  && ((rl->mode == DImode 
+		        && dimode_inv_reg_alloc_order[regno]
+		           < dimode_inv_reg_alloc_order[best_reg])
+		      || (rl->mode != DImode
+#ifdef REG_ALLOC_ORDER
+			  && (inv_reg_alloc_order[regno]
+			      < inv_reg_alloc_order[best_reg])
+#else
+			  && call_used_regs[regno]
+			  && ! call_used_regs[best_reg]
+#endif
+		    ))
+#else
 #ifdef REG_ALLOC_ORDER
 		  && (inv_reg_alloc_order[regno]
 		      < inv_reg_alloc_order[best_reg])
@@ -1804,6 +1819,8 @@
 		  && call_used_regs[regno]
 		  && ! call_used_regs[best_reg]
 #endif
+#endif
+/* APPLE LOCAL end 5831562 add DIMODE_REG_ALLOC_ORDER */
 		  ))
 	    {
 	      best_reg = regno;

Modified: llvm-gcc-4.2/trunk/gcc/tree.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=54177&r1=54176&r2=54177&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/tree.c (original)
+++ llvm-gcc-4.2/trunk/gcc/tree.c Tue Jul 29 17:46:06 2008
@@ -1911,7 +1911,7 @@
     case SAVE_EXPR:         case COMPOUND_EXPR:       case MODIFY_EXPR:
     case INIT_EXPR:         case TARGET_EXPR:         case WITH_CLEANUP_EXPR:
     case CLEANUP_POINT_EXPR:
-      /* These don't change the alignment of an object. */
+      /* These don't change the alignment of an object.  */
       return expr_align (TREE_OPERAND (t, 0));
 
     case COND_EXPR:
@@ -5102,6 +5102,25 @@
   return build_pointer_type_for_mode (to_type, ptr_mode, false);
 }
 
+/* APPLE LOCAL begin radar 5732232 - blocks */
+tree
+build_block_pointer_type (tree to_type)
+{
+  tree t;
+  
+  t = make_node (BLOCK_POINTER_TYPE);
+
+  TREE_TYPE (t) = to_type;
+  TYPE_MODE (t) = ptr_mode;
+
+  /* Lay out the type.  This function has many callers that are concerned
+     with expression-construction, and this simplifies them all.  */
+  layout_type (t);
+
+  return t;
+}
+/* APPLE LOCAL end radar 5732232 - blocks */
+
 /* Same as build_pointer_type_for_mode, but for REFERENCE_TYPE.  */
 
 tree
@@ -6919,7 +6938,12 @@
       /* APPLE LOCAL begin AltiVec */
       outer = (TREE_CODE (type) == REFERENCE_TYPE
 	       ? build_reference_type (inner)
-	       : build_pointer_type (inner));
+               /* APPLE LOCAL begin blocks 5882266 */
+	       : (TREE_CODE (type) == BLOCK_POINTER_TYPE ? 
+                  build_block_pointer_type (inner) : 
+                  build_pointer_type (inner))
+               );
+               /* APPLE LOCAL end blocks 5882266 */
       /* APPLE LOCAL end AltiVec */
     }
   else if (TREE_CODE (type) == ARRAY_TYPE)





More information about the llvm-commits mailing list