Hi Tyler, <div><br></div><div>Doesn't look right. Would you mind attaching the test? <br><br>Btw, instead of creating an empty function and CloneFunctionInto, can you just CloneFunction? <div><br></div><div>Jingyue</div></div><br><div class="gmail_quote">On Thu Oct 02 2014 at 2:47:51 PM Tyler Denniston <<a href="mailto:tyler@csail.mit.edu">tyler@csail.mit.edu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm trying to create a clone of a function using Function::Create()<br>
and CloneFunctionInto. However, I'm running into an issue. I believe<br>
that the instructions in the function clone still have Use edges to<br>
values in the original function. This is a problem for my purposes.<br>
<br>
For example, consider an original function F. I create a new function<br>
G belonging to the same module and call CloneFunctionInto(G, F) to<br>
copy over the function body. Now, consider a phi node p in F, and an<br>
instruction I in F which uses p. The problem is, the cloned phi node<br>
p' in G still lists I as a user.<br>
<br>
Is this intended behavior? And if so, is there a way I can remove<br>
these Use edges in my cloned function?<br>
<br>
Thanks,<br>
<br>
Tyler<br>
<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<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><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</blockquote></div>