[LLVMdev] BasicBlock Cloning
tarun agrawal
tarun at cse.iitb.ac.in
Tue May 3 23:27:21 PDT 2011
Thank you john that has really worked for me
On Wed, May 4, 2011 at 7:02 AM, John Criswell <criswell at illinois.edu> wrote:
> On 5/3/11 4:14 PM, tarun agrawal wrote:
>
> Hi
>
> I have clone a basic block using CloneBasicBlock function but it does not
> clone the predecessor with it. I am not able to figure out, how to set the
> predecessor of the cloned basic block.
>
>
> LLVM's CFG is explicitly maintained by the terminator instructions within
> each basic block. In order to change the CFG, you have to change the
> terminator instructions.
>
> To make BasicBlock B a successor of BasicBlock A, you have to modify or
> replace BasicBlock A's terminator instruction to branch to BasicBlock B.
>
> -- John T.
>
>
> Tarun
>
>
> _______________________________________________
> LLVM Developers mailing listLLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110504/666e1eb9/attachment.html>
More information about the llvm-dev
mailing list