Thank you john that has really worked for me<br><br><div class="gmail_quote">On Wed, May 4, 2011 at 7:02 AM, John Criswell <span dir="ltr"><<a href="mailto:criswell@illinois.edu">criswell@illinois.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

  
    
  
  <div bgcolor="#ffffff" text="#000000"><div class="im">
    On 5/3/11 4:14 PM, tarun agrawal wrote:
    <blockquote type="cite">
      
      Hi<br>
      <br>
      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.<br>
    </blockquote>
    <br></div>
    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.<br>
    <br>
    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.<br>
    <br>
    -- John T.<br>
    <br>
    <blockquote type="cite"><br>
      Tarun<br>
      <pre><fieldset></fieldset>
_______________________________________________
LLVM Developers mailing list
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><br>