Make this print the right start pointer
authorChris Lattner <sabre@nondot.org>
Tue, 16 May 2006 06:45:50 +0000 (06:45 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 16 May 2006 06:45:50 +0000 (06:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28321 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JITEmitter.cpp

index 00b23c173888451ae64f179db33e2a9851537521..011b38648c4f05bf11f8a5c74d18b77502d3f359 100644 (file)
@@ -815,9 +815,11 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
     }
   }
 
-  DEBUG(std::cerr << "JIT: Finished CodeGen of [" << (void*)BufferBegin
+  DEBUG(void *FnStart = TheJIT->getPointerToGlobalIfAvailable(F.getFunction());
+        char *FnEnd   = (char*)getCurrentPCOffset();
+        std::cerr << "JIT: Finished CodeGen of [" << FnStart
                   << "] Function: " << F.getFunction()->getName()
-                  << ": " << getCurrentPCOffset() << " bytes of text, "
+                  << ": " << (FnEnd-(char*)FnStart) << " bytes of text, "
                   << Relocations.size() << " relocations\n");
   Relocations.clear();
   return false;