From 3ac38e99b958bfdeff1653c5ec59677d2a9fab4f Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 26 Jan 2007 08:11:39 +0000 Subject: For PR761: The Module::setEndianness and Module::setPointerSize methods have been removed. Instead you can get/set the DataLayout. Adjust thise accordingly. llvm-svn: 33530 --- .../ExecutionEngine/Interpreter/Interpreter.cpp | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'llvm/lib/ExecutionEngine/Interpreter') diff --git a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp index 4728c95b743..d39b5e1cf6c 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp @@ -39,18 +39,17 @@ ExecutionEngine *Interpreter::create(ModuleProvider *MP) { 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); } -- cgit v1.2.3