Only count instructions as code size, not constant pools and other per-function stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28827 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-06-16 18:09:26 +00:00
parent 276f4b5235
commit a827953c32

View File

@ -760,8 +760,14 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
emitJumpTableInfo(F.getJumpTableInfo()); emitJumpTableInfo(F.getJumpTableInfo());
MemMgr.endFunctionBody(F.getFunction(), BufferBegin, CurBufferPtr); // FnStart is the start of the text, not the start of the constant pool and
NumBytes += getCurrentPCOffset(); // other per-function data.
unsigned char *FnStart =
(unsigned char *)TheJIT->getPointerToGlobalIfAvailable(F.getFunction());
unsigned char *FnEnd = CurBufferPtr;
MemMgr.endFunctionBody(F.getFunction(), BufferBegin, FnEnd);
NumBytes += FnEnd-FnStart;
if (!Relocations.empty()) { if (!Relocations.empty()) {
NumRelos += Relocations.size(); NumRelos += Relocations.size();
@ -815,11 +821,9 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
} }
} }
DEBUG(void *FnStart = TheJIT->getPointerToGlobalIfAvailable(F.getFunction()); DEBUG(std::cerr << "JIT: Finished CodeGen of [" << (void*)FnStart
char *FnEnd = (char*)getCurrentPCOffset();
std::cerr << "JIT: Finished CodeGen of [" << FnStart
<< "] Function: " << F.getFunction()->getName() << "] Function: " << F.getFunction()->getName()
<< ": " << (FnEnd-(char*)FnStart) << " bytes of text, " << ": " << (FnEnd-FnStart) << " bytes of text, "
<< Relocations.size() << " relocations\n"); << Relocations.size() << " relocations\n");
Relocations.clear(); Relocations.clear();
return false; return false;