Fix PR18743.
[oota-llvm.git] / lib / Target / Sparc / SparcTargetMachine.cpp
index 172bb66b7c8c77de5396c06b78264f39a2fd3920..83f3474759b62d7719191400c3cdb766a1cac360 100644 (file)
@@ -25,7 +25,7 @@ extern "C" void LLVMInitializeSparcTarget() {
 
 static std::string computeDataLayout(const SparcSubtarget &ST) {
   // Sparc is big endian.
-  std::string Ret = "E";
+  std::string Ret = "E-m:e";
 
   // Some ABIs have 32bit pointers.
   if (!ST.is64Bit())
@@ -41,6 +41,11 @@ static std::string computeDataLayout(const SparcSubtarget &ST) {
   else
     Ret += "-f128:64-n32";
 
+  if (ST.is64Bit())
+    Ret += "-S128";
+  else
+    Ret += "-S64";
+
   return Ret;
 }