[LLVMdev] Getting the start and end address of JITted code

Andrew Haley aph at redhat.com
Wed Dec 17 10:23:26 PST 2008


Here's my problem, which I raised on IRC:

JIT::getPointerToFunction gets the address of the start of a function.
But how do I find out where the end of the function is?  I need this
to register the function for profiling.

varth said: aph, you need to intercept the "endFunctionBody" call on
the memory manager, it will tell you the start pointer and the end
pointer

But how can I do this?  The obvious way would be for me to inherit
from DefaultMemoryManager and pass an instance of my class to
ExecutionEngine::createJIT.  But DefaultMemoryManager isn't public so
I can't inherit from it.  It's not at all obvious to me how I'm
supposed to intercept endFunctionBody.

Thanks,
Andrew.




More information about the llvm-dev mailing list