<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 5/3/11 4:14 PM, tarun agrawal wrote:
<blockquote
cite="mid:BANLkTinCCo7TPBhq7RYMciU2fB6-ar1+jg@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
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>
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
cite="mid:BANLkTinCCo7TPBhq7RYMciU2fB6-ar1+jg@mail.gmail.com"
type="cite"><br>
Tarun<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>