diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-01-26 08:11:39 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-01-26 08:11:39 +0000 |
commit | 3ac38e99b958bfdeff1653c5ec59677d2a9fab4f (patch) | |
tree | 3438c18c89bea2cc66d0996c252f3b74589b438f /llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp | |
parent | 675fb2301fa8b77e8d6d0b84be7a5799d1ab9b01 (diff) | |
download | bcm5719-llvm-3ac38e99b958bfdeff1653c5ec59677d2a9fab4f.tar.gz bcm5719-llvm-3ac38e99b958bfdeff1653c5ec59677d2a9fab4f.zip |
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
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
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); } |