<div class="gmail_quote">On 8 September 2011 10:57, Devang Patel <span dir="ltr"><<a href="mailto:dpatel@apple.com">dpatel@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div style="word-wrap:break-word">Hi Paul,<div><br></div><div><div><div></div><div class="h5"><div><div>On Sep 8, 2011, at 10:52 AM, Redmond, Paul wrote:</div><br><blockquote type="cite"><span style="border-collapse:separate;font-family:Verdana;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div lang="EN-US" link="blue" vlink="purple">

<div><div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:11pt;font-family:Calibri, sans-serif">Hi,<u></u><u></u></div><div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:11pt;font-family:Calibri, sans-serif">

<u></u> <u></u></div><div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:11pt;font-family:Calibri, sans-serif">Can anyone point me to some code (or offer advice) on how I can merge one Module into another?<u></u><u></u></div>

<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:11pt;font-family:Calibri, sans-serif"><u></u> <u></u></div><div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:11pt;font-family:Calibri, sans-serif">

I have a list of Modules each containing one Function. I would like to combine them all into one monolithic Module before transforming and optimizing (The original Modules must remain unmodified)<u></u><u></u></div><div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:11pt;font-family:Calibri, sans-serif">

<br></div></div></div></span></blockquote><br></div></div></div><div>See Linker::LinkModules(..).</div></div></div></blockquote><div><br></div><div>Mm, I think LinkModules is destructive to one of its input modules. Try CloneFunction <a href="http://llvm.org/doxygen/namespacellvm.html#aabb040f50a7e75ad8d58bfc5d95636a4">http://llvm.org/doxygen/namespacellvm.html#aabb040f50a7e75ad8d58bfc5d95636a4</a> maybe?</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><div>-</div><div>Devang</div><span class="HOEnZb"><font color="#888888"><br>

</font></span></div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">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/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br>