[llvm-commits] [124573] Fix http://llvm.org/bugs/show_bug.cgi?id=1242, by emitting a more-complete

clattner at apple.com clattner at apple.com
Mon Mar 5 17:07:11 PST 2007


Revision: 124573
Author:   clattner
Date:     2007-03-05 17:07:09 -0800 (Mon, 05 Mar 2007)

Log Message:
-----------
Fix http://llvm.org/bugs/show_bug.cgi?id=1242, by emitting a more-complete
target data string.  On darwin, we now emit:
target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
instead of:
target datalayout = "E-p:32:32"

Modified Paths:
--------------
    apple-local/branches/llvm/gcc/llvm-backend.cpp

Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-backend.cpp	2007-03-06 00:42:33 UTC (rev 124572)
+++ apple-local/branches/llvm/gcc/llvm-backend.cpp	2007-03-06 01:07:09 UTC (rev 124573)
@@ -140,11 +140,6 @@
 #endif
   TheModule->setTargetTriple(TargetTriple);
   
-  std::string DataLayout;
-  DataLayout.append(BITS_BIG_ENDIAN ? "E" : "e");
-  DataLayout.append(POINTER_SIZE == 32 ? "-p:32:32" : "-p:64:64");
-  TheModule->setDataLayout(DataLayout);
-  
   TheTypeConverter = new TypeConverter();
   
   // Create the TargetMachine we will be generating code with.
@@ -156,7 +151,7 @@
     cerr << "Did not get a target machine!\n";
     exit(1);
   }
-  
+
   // Figure out the subtarget feature string we pass to the target.
   std::string FeatureStr;
   // The target can set LLVM_SET_SUBTARGET_FEATURES to configure the LLVM
@@ -168,6 +163,11 @@
 #endif
   TheTarget = TME->CtorFn(*TheModule, FeatureStr);
 
+  // Install information about target datalayout stuff into the module for
+  // optimizer use.
+  TheModule->setDataLayout(TheTarget->getTargetData()->
+                           getStringRepresentation());
+  
   if (optimize) {
     RegisterScheduler::setDefault(createDefaultScheduler);
   } else {





More information about the llvm-commits mailing list