[llvm] r203664 - Update the datalayout string for ppc64LE.

Will Schmidt will_schmidt at vnet.ibm.com
Wed Mar 12 07:59:17 PDT 2014


Author: willschm
Date: Wed Mar 12 09:59:17 2014
New Revision: 203664

URL: http://llvm.org/viewvc/llvm-project?rev=203664&view=rev
Log:
Update the datalayout string for ppc64LE.

Update the datalayout string for ppc64LE.


Modified:
    llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=203664&r1=203663&r2=203664&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Wed Mar 12 09:59:17 2014
@@ -37,8 +37,13 @@ extern "C" void LLVMInitializePowerPCTar
 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);
 





More information about the llvm-commits mailing list