[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp

Reid Spencer reid at x10sys.com
Fri Jan 26 00:12:04 PST 2007



Changes in directory llvm/lib/ExecutionEngine/Interpreter:

Interpreter.cpp updated: 1.33 -> 1.34
---
Log message:

For PR761: http://llvm.org/PR761 :
The Module::setEndianness and Module::setPointerSize methods have been
removed. Instead you can get/set the DataLayout. Adjust thise accordingly.


---
Diffs of the changes:  (+11 -12)

 Interpreter.cpp |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)


Index: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp
diff -u llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.33 llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.34
--- llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.33	Wed Nov 15 12:00:10 2006
+++ llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp	Fri Jan 26 02:11:39 2007
@@ -39,18 +39,17 @@
     return 0;  // error materializing the module.
   }
   
-  if (M->getEndianness() == Module::AnyEndianness) {
-    int Test = 0;
-    *(char*)&Test = 1;    // Return true if the host is little endian
-    bool isLittleEndian = (Test == 1);
-    M->setEndianness(isLittleEndian ? Module::LittleEndian : Module::BigEndian);
-  }
-
-  if (M->getPointerSize() == Module::AnyPointerSize) {
-    // Follow host.
-    bool Ptr64 = sizeof(void*) == 8;
-    M->setPointerSize(Ptr64 ? Module::Pointer64 : Module::Pointer32);
-  }
+  // FIXME: This should probably compute the entire data layout
+  std::string DataLayout;
+  int Test = 0;
+  *(char*)&Test = 1;    // Return true if the host is little endian
+  bool isLittleEndian = (Test == 1);
+  DataLayout.append(isLittleEndian ? "e" : "E");
+
+	bool Ptr64 = sizeof(void*) == 8;
+	DataLayout.append(Ptr64 ? "-p:64:64" : "-p:32:32");
+	
+  M->setDataLayout(DataLayout);
 
   return new Interpreter(M);
 }






More information about the llvm-commits mailing list