<div dir="ltr">I am reading the implementation of llvm::JIT::getPointerToBasicBlock and I think there might be a bug in it.<div><br></div><div>'getPointerToBasicBlock' first calls 'getPointerToFunction' and then try to look up the map returned by 'getBasicBlockAddressMap(locked)' to get the pointer of the BasicBlock.</div>

<div><br></div><div> '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.</div>

<div><br></div><div style>Is this a bug? Or I should not call the function this way?</div><div><div><div dir="ltr"><div><br></div><div><br></div><div>Bin LI,</div><div>State Key Laboratory of Computer Architecture,</div>
<div>
Institute of Computing Technology of Chinese Academy of Sciences,</div><div>email: <a href="mailto:richardustc@gmail.com" target="_blank">richardustc@gmail.com</a></div></div></div>
</div></div>