[llvm-commits] [llvm-gcc-4.2] r134133 - in /llvm-gcc-4.2/trunk/gcc: config/arm/arm.h config/i386/i386.h config/rs6000/rs6000.h llvm-backend.cpp

Evan Cheng evan.cheng at apple.com
Wed Jun 29 22:12:47 PDT 2011


Author: evancheng
Date: Thu Jun 30 00:12:47 2011
New Revision: 134133

URL: http://llvm.org/viewvc/llvm-project?rev=134133&view=rev
Log:
Match createTargetMachine API change.

Modified:
    llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
    llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
    llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h
    llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp

Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.h?rev=134133&r1=134132&r2=134133&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Thu Jun 30 00:12:47 2011
@@ -3460,56 +3460,56 @@
 
 /* Turn -march=xx into a CPU type.
  */
-#define LLVM_SET_SUBTARGET_FEATURES(F) \
+#define LLVM_SET_SUBTARGET_FEATURES(C, F)        \
   { switch (arm_tune) { \
-    case arm8:          F.setCPU("arm8"); break;\
-    case arm810:        F.setCPU("arm810"); break;\
-    case strongarm:     F.setCPU("strongarm"); break;\
-    case strongarm110:  F.setCPU("strongarm110"); break;\
-    case strongarm1100: F.setCPU("strongarm1100"); break;\
-    case strongarm1110: F.setCPU("strongarm1110"); break;\
-    case arm7tdmi:      F.setCPU("arm7tdmi"); break;\
-    case arm7tdmis:     F.setCPU("arm7tdmi-s"); break;\
-    case arm710t:       F.setCPU("arm710t"); break;\
-    case arm720t:       F.setCPU("arm720t"); break;\
-    case arm740t:       F.setCPU("arm740t"); break;\
-    case arm9:          F.setCPU("arm9"); break;\
-    case arm9tdmi:      F.setCPU("arm9tdmi"); break;\
-    case arm920:        F.setCPU("arm920"); break;\
-    case arm920t:       F.setCPU("arm920t"); break;\
-    case arm922t:       F.setCPU("arm922t"); break;\
-    case arm940t:       F.setCPU("arm940t"); break;\
-    case ep9312:        F.setCPU("ep9312"); break;\
-    case arm10tdmi:     F.setCPU("arm10tdmi"); break;\
-    case arm1020t:      F.setCPU("arm1020t"); break;\
-    case arm9e:         F.setCPU("arm9e"); break;\
-    case arm946es:      F.setCPU("arm946e-s"); break;\
-    case arm966es:      F.setCPU("arm966e-s"); break;\
-    case arm968es:      F.setCPU("arm968e-s"); break;\
-    case arm10e:        F.setCPU("arm10e"); break;\
-    case arm1020e:      F.setCPU("arm1020e"); break;\
-    case arm1022e:      F.setCPU("arm1022e"); break;\
-    case xscale:        F.setCPU("xscale"); break;\
-    case iwmmxt:        F.setCPU("iwmmxt"); break;\
-    case arm926ejs:     F.setCPU("arm926ej-s"); break;\
-    case arm1026ejs:    F.setCPU("arm1026ej-s"); break;\
-    case arm1136js:     F.setCPU("arm1136j-s"); break;\
-    case arm1136jfs:    F.setCPU("arm1136jf-s"); break;\
-    case arm1176jzs:    F.setCPU("arm1176jz-s"); break;\
-    case arm1176jzfs:   F.setCPU("arm1176jzf-s"); break;\
-    case mpcorenovfp:   F.setCPU("mpcorenovfp"); break;\
-    case mpcore:        F.setCPU("mpcore"); break;\
-    case arm1156t2s:    F.setCPU("arm1156t2-s"); break;	\
-    case arm1156t2fs:   F.setCPU("arm1156t2f-s"); break; \
-    case cortexa8:      F.setCPU("cortex-a8"); break; \
-    case cortexa9:      F.setCPU("cortex-a9"); break; \
-    case cortexa9mp:    F.setCPU("cortex-a9-mp"); break; \
-    case cortexr4:      F.setCPU("cortex-r4"); break; \
-    case cortexm3:      F.setCPU("cortex-m3"); break; \
-    case cortexm4:      F.setCPU("cortex-m4"); break; \
-    case cortexm0:      F.setCPU("cortex-m0"); break; \
+    case arm8:          C = ("arm8"); break;\
+    case arm810:        C = ("arm810"); break;\
+    case strongarm:     C = ("strongarm"); break;\
+    case strongarm110:  C = ("strongarm110"); break;\
+    case strongarm1100: C = ("strongarm1100"); break;\
+    case strongarm1110: C = ("strongarm1110"); break;\
+    case arm7tdmi:      C = ("arm7tdmi"); break;\
+    case arm7tdmis:     C = ("arm7tdmi-s"); break;\
+    case arm710t:       C = ("arm710t"); break;\
+    case arm720t:       C = ("arm720t"); break;\
+    case arm740t:       C = ("arm740t"); break;\
+    case arm9:          C = ("arm9"); break;\
+    case arm9tdmi:      C = ("arm9tdmi"); break;\
+    case arm920:        C = ("arm920"); break;\
+    case arm920t:       C = ("arm920t"); break;\
+    case arm922t:       C = ("arm922t"); break;\
+    case arm940t:       C = ("arm940t"); break;\
+    case ep9312:        C = ("ep9312"); break;\
+    case arm10tdmi:     C = ("arm10tdmi"); break;\
+    case arm1020t:      C = ("arm1020t"); break;\
+    case arm9e:         C = ("arm9e"); break;\
+    case arm946es:      C = ("arm946e-s"); break;\
+    case arm966es:      C = ("arm966e-s"); break;\
+    case arm968es:      C = ("arm968e-s"); break;\
+    case arm10e:        C = ("arm10e"); break;\
+    case arm1020e:      C = ("arm1020e"); break;\
+    case arm1022e:      C = ("arm1022e"); break;\
+    case xscale:        C = ("xscale"); break;\
+    case iwmmxt:        C = ("iwmmxt"); break;\
+    case arm926ejs:     C = ("arm926ej-s"); break;\
+    case arm1026ejs:    C = ("arm1026ej-s"); break;\
+    case arm1136js:     C = ("arm1136j-s"); break;\
+    case arm1136jfs:    C = ("arm1136jf-s"); break;\
+    case arm1176jzs:    C = ("arm1176jz-s"); break;\
+    case arm1176jzfs:   C = ("arm1176jzf-s"); break;\
+    case mpcorenovfp:   C = ("mpcorenovfp"); break;\
+    case mpcore:        C = ("mpcore"); break;\
+    case arm1156t2s:    C = ("arm1156t2-s"); break;	\
+    case arm1156t2fs:   C = ("arm1156t2f-s"); break; \
+    case cortexa8:      C = ("cortex-a8"); break; \
+    case cortexa9:      C = ("cortex-a9"); break; \
+    case cortexa9mp:    C = ("cortex-a9-mp"); break; \
+    case cortexr4:      C = ("cortex-r4"); break; \
+    case cortexm3:      C = ("cortex-m3"); break; \
+    case cortexm4:      C = ("cortex-m4"); break; \
+    case cortexm0:      C = ("cortex-m0"); break; \
     default:						\
-      F.setCPU("arm7tdmi"); \
+      C = ("arm7tdmi"); \
       break; \
     } \
     if (TARGET_VFP3)						\

Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h?rev=134133&r1=134132&r2=134133&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/i386.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Thu Jun 30 00:12:47 2011
@@ -3879,11 +3879,11 @@
 
 /* Turn -march=xx into a CPU type.
  */
-#define LLVM_SET_SUBTARGET_FEATURES(F) \
+#define LLVM_SET_SUBTARGET_FEATURES(C, F)                     \
   { if (TARGET_MACHO && ! strcmp (ix86_arch_string, "apple")) \
-      F.setCPU(TARGET_64BIT ? "core2" : "yonah");             \
+      C = (TARGET_64BIT ? "core2" : "yonah");                 \
     else                                                      \
-      F.setCPU(ix86_arch_string);                             \
+      C = (ix86_arch_string);                                 \
     if (TARGET_64BIT)   F.AddFeature("64bit");                \
     if (TARGET_MMX)     F.AddFeature("mmx");                  \
     else if (target_flags_explicit & MASK_MMX) F.AddFeature("mmx", false); \

Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h?rev=134133&r1=134132&r2=134133&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.h Thu Jun 30 00:12:47 2011
@@ -3459,11 +3459,11 @@
 
 /* Turn -march=xx into a CPU type.
  */
-#define LLVM_SET_SUBTARGET_FEATURES(F) \
+#define LLVM_SET_SUBTARGET_FEATURES(C, F)    \
   { \
-    F.setCPU(rs6000_cpu_target); \
+    C = (rs6000_cpu_target);                 \
     F.AddFeature("altivec", TARGET_ALTIVEC); \
-    F.AddFeature("gpul", TARGET_MFCRF); \
+    F.AddFeature("gpul", TARGET_MFCRF);      \
     F.AddFeature("fsqrt", TARGET_PPC_GPOPT); \
     F.AddFeature("64bit", TARGET_POWERPC64); \
   }

Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=134133&r1=134132&r2=134133&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Thu Jun 30 00:12:47 2011
@@ -537,10 +537,12 @@
   // Figure out the subtarget feature string we pass to the target.
   std::string FeatureStr;
   SubtargetFeatures Features;
+
   // The target can set LLVM_SET_SUBTARGET_FEATURES to configure the LLVM
   // backend.
+  std::string CPU;
 #ifdef LLVM_SET_SUBTARGET_FEATURES
-  LLVM_SET_SUBTARGET_FEATURES(Features);
+  LLVM_SET_SUBTARGET_FEATURES(CPU, Features);
 #endif
   
   // Handle -mattr options passed into llvm
@@ -548,7 +550,7 @@
     Features.AddFeature(MAttrs[i]);
   FeatureStr = Features.getString();
 
-  TheTarget = TME->createTargetMachine(TargetTriple, FeatureStr);
+  TheTarget = TME->createTargetMachine(TargetTriple, CPU, FeatureStr);
   TheTarget->setMCUseLoc(false);
   TheTarget->setMCUseCFI(false);
   assert(TheTarget->getTargetData()->isBigEndian() == BYTES_BIG_ENDIAN);





More information about the llvm-commits mailing list