Build the appropriate target machine for the input pointer size and endianness
llvm-svn: 5838
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 73052c0..6906465 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -75,10 +75,8 @@
}
#endif
- // FIXME: This should look at the PointerSize and endianness of the bytecode
- // file to determine the endianness and pointer size of target machine to use.
- unsigned Config = TM::PtrSize64 | TM::BigEndian;
-
+ unsigned Config = (M->isLittleEndian() ? TM::LittleEndian : TM::BigEndian) |
+ (M->has32BitPointers() ? TM::PtrSize32 : TM::PtrSize64);
ExecutionEngine *EE = 0;
// If there is nothing that is forcing us to use the interpreter, make a JIT.