[LLVMdev] is this a bug of llvm::JIT::getPointerToBasicBlock?

Li Bin richardustc at gmail.com
Fri Jun 21 05:12:27 PDT 2013


I am reading the implementation of llvm::JIT::getPointerToBasicBlock and I
think there might be a bug in it.

'getPointerToBasicBlock' first calls 'getPointerToFunction' and then try to
look up the map returned by 'getBasicBlockAddressMap(locked)' to get the
pointer of the BasicBlock.

 'getPointerToFunction' calls 'runJITOnFunctionUnlocked' which in turn
calls 'jitTheFunction'. However, in 'jitTheFunction, there is a statement
'getBasicBlockAddressMap(locked).clear()'.  After returning from
'getPointerToFunction', the map is empty. So, you will never get the
pointer of the BasicBlock.

Is this a bug? Or I should not call the function this way?


Bin LI,
State Key Laboratory of Computer Architecture,
Institute of Computing Technology of Chinese Academy of Sciences,
email: richardustc at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130621/bc6ab869/attachment.html>


More information about the llvm-dev mailing list