Update the datalayout string for ppc64LE.
authorWill Schmidt <will_schmidt@vnet.ibm.com>
Wed, 12 Mar 2014 14:59:17 +0000 (14:59 +0000)
committerWill Schmidt <will_schmidt@vnet.ibm.com>
Wed, 12 Mar 2014 14:59:17 +0000 (14:59 +0000)
Update the datalayout string for ppc64LE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203664 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCTargetMachine.cpp

index 46d2064a18d445c74043ea73cb88ba60de4a8b6f..36d2100ac51af464149c4423751f86f68a28aae5 100644 (file)
@@ -37,8 +37,13 @@ extern "C" void LLVMInitializePowerPCTarget() {
 static std::string getDataLayoutString(const PPCSubtarget &ST) {
   const Triple &T = ST.getTargetTriple();
 
-  // PPC is big endian.
-  std::string Ret = "E";
+  std::string Ret;
+
+  // Most PPC* platforms are big endian, PPC64LE is little endian.
+  if (ST.isLittleEndian())
+    Ret = "e";
+  else
+    Ret = "E";
 
   Ret += DataLayout::getManglingComponent(T);