[LLVMdev] Saving a reference to a Basic Block?

Caldarale, Charles R Chuck.Caldarale at unisys.com
Sat Nov 10 07:41:05 PST 2012


> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of John Slagel
> Subject: [LLVMdev] Saving a reference to a Basic Block?

> Is there a way to save a reference to a Basic Block that gets all fixed 
> up in the linker, so that you can branch to it during execution?

We use the blockaddress() constant generator, coupled with the indirectbr instruction:

http://llvm.org/releases/3.1/docs/LangRef.html#blockaddress
http://llvm.org/releases/3.1/docs/LangRef.html#i_indirectbr

Note that all target basic blocks of indirectbr must be provided to the instruction as part of the IR construction.

Also, at least the x86_64 target for the legacy JIT is missing some required functionality for handling blockaddress(); we've fixed that locally, but need to check what the MCJIT does before submitting a patch.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.





More information about the llvm-dev mailing list