Some fixes for x86-64 JIT. Make it use small code
model, except for external calls; this makes
addressing modes PC-relative. Incomplete.
The assertion at the top of Emitter::runOnMachineFunction
was obviously bogus (always true) so I removed it.
If someone knows what the correct test should be to cover
all the various targets, please fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54656 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index d38f9f9..3100f06 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -920,9 +920,22 @@
Relocations.clear();
#ifndef NDEBUG
+ {
+ DOUT << std::hex;
+ int i;
+ unsigned char* q = FnStart;
+ for (i=1; q!=FnEnd; q++, i++) {
+ if (i%8==1)
+ DOUT << "0x" << (long)q << ": ";
+ DOUT<< (unsigned short)*q << " ";
+ if (i%8==0)
+ DOUT<<"\n";
+ }
+ DOUT << std::dec;
if (sys::hasDisassembler())
DOUT << "Disassembled code:\n"
<< sys::disassembleBuffer(FnStart, FnEnd-FnStart, (uintptr_t)FnStart);
+ }
#endif
if (ExceptionHandling) {
uintptr_t ActualSize = 0;