<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 4/8/14, 5:28 AM, Peter Conn wrote:<br>
</div>
<blockquote
cite="mid:CAExKx_kRYB2SLwu=cvo2p=xzMBmtCP7JZr_fqQiZddqhqw5XNA@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div dir="ltr">Hello,
<div><br>
</div>
<div>I'm trying to replace all uses of StructType A with
StructType B. I've created a class that inherits
from ValueMapTypeRemapper, returns B whenever A is passed to
it, and used this class with the CloneFunctionInto function.</div>
<div><br>
</div>
<div>Is there a way to clone a function into itself? Currently
I've got duplicates of most of my functions, which is fine,
but I don't need to duplicate main, so I'm looking for a way
to replace all uses of A with B inside main.</div>
</div>
</blockquote>
<br>
You can clone main() into a new function, the rename main() to
something else (e.g., oldmain()), and then rename your new function
main(). In fact, I think Value * now has a takeName() method that
allows you to do the renaming with a single method call.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
<blockquote
cite="mid:CAExKx_kRYB2SLwu=cvo2p=xzMBmtCP7JZr_fqQiZddqhqw5XNA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Thanks,</div>
<div>Peter</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
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>