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

Evan Cheng evan.cheng at apple.com
Fri Apr 11 17:22:01 PDT 2008


Author: evancheng
Date: Fri Apr 11 19:22:01 2008
New Revision: 49566

URL: http://llvm.org/viewvc/llvm-project?rev=49566&view=rev
Log:
Add debugging code.

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=49566&r1=49565&r2=49566&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Fri Apr 11 19:22:01 2008
@@ -233,8 +233,7 @@
   if (!idx) {
     idx = ++nextGOTIndex;
     revGOTMap[addr] = idx;
-    DOUT << "Adding GOT entry " << idx
-         << " for addr " << addr << "\n";
+    DOUT << "Adding GOT entry " << idx << " for addr " << addr << "\n";
   }
   return idx;
 }
@@ -746,11 +745,15 @@
     ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal->getType();
   Size += TheJIT->getTargetData()->getABITypeSize(Ty);
 
-  ConstantPoolBase = allocateSpace(Size, 1 << MCP->getConstantPoolAlignment());
+  unsigned Align = 1 << MCP->getConstantPoolAlignment();
+  ConstantPoolBase = allocateSpace(Size, Align);
   ConstantPool = MCP;
 
   if (ConstantPoolBase == 0) return;  // Buffer overflow.
 
+  DOUT << "JIT: Emitted constant pool at [" << ConstantPoolBase
+       << "] (size: " << Size << ", alignment: " << Align << ")\n";
+
   // Initialize the memory for all of the constant pool entries.
   for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
     void *CAddr = (char*)ConstantPoolBase+Constants[i].Offset;
@@ -761,6 +764,7 @@
       abort();
     }
     TheJIT->InitializeMemory(Constants[i].Val.ConstVal, CAddr);
+    DOUT << "JIT:   CP" << i << " at [" << CAddr << "]\n";
   }
 }
 





More information about the llvm-commits mailing list