Undo 58778 but makes the binary dump prettier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-11-05 23:44:08 +00:00
parent b4b130f0b1
commit a7916f586d

View File

@ -38,6 +38,9 @@
#include "llvm/ADT/Statistic.h"
#include <algorithm>
#include <set>
#ifndef NDEBUG
#include <iomanip>
#endif
using namespace llvm;
STATISTIC(NumBytes, "Number of bytes of machine code compiled");
@ -954,9 +957,24 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
MemMgr->setMemoryExecutable();
#ifndef NDEBUG
if (sys::hasDisassembler())
DOUT << "Disassembled code:\n"
<< sys::disassembleBuffer(FnStart, FnEnd-FnStart, (uintptr_t)FnStart);
{
if (sys::hasDisassembler())
DOUT << "Disassembled code:\n"
<< sys::disassembleBuffer(FnStart, FnEnd-FnStart, (uintptr_t)FnStart);
else {
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<< std::setw(2) << std::setfill('0') << (unsigned short)*q << " ";
if (i%8==0)
DOUT<<"\n";
}
DOUT << std::dec;
}
}
#endif
if (ExceptionHandling) {
uintptr_t ActualSize = 0;