#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");
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;