[llvm-commits] [llvm] r58782 - /llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp

Dale Johannesen dalej at apple.com
Wed Nov 5 16:08:37 PST 2008


On Nov 5, 2008, at 3:44 PMPST, Evan Cheng wrote:

> Author: evancheng
> Date: Wed Nov  5 17:44:08 2008
> New Revision: 58782
>
> URL: http://llvm.org/viewvc/llvm-project?rev=58782&view=rev
> Log:
> Undo 58778 but makes the binary dump prettier.

That will do, thanks!

> Modified:
>    llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
>
> Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=58782&r1=58781&r2=58782&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Wed Nov  5  
> 17:44:08 2008
> @@ -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 @@
>   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;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list