<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Have you looked at llvm-extract tool ?<div>-</div><div>Devang</div><div><br><div><div>On Aug 9, 2011, at 11:40 PM, Ananth Durbha wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>fixing missing subject line in original email.</div><div><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2">----- Forwarded Message -----<br><b><span style="font-weight:bold;">From:</span></b> Ananth Durbha <<a href="mailto:avdurbha@yahoo.com">avdurbha@yahoo.com</a>><br><b><span style="font-weight: bold;">To:</span></b> llvm list <<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>><br><b><span style="font-weight: bold;">Sent:</span></b> Tuesday, August 9, 2011 11:38 PM<br><b><span style="font-weight: bold;">Subject:</span></b> <br></font><br><div id="yiv478754071"><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><div>Hi,</div><div>     I am
 interested in getting llvm IR only for a subset of the input source code - basically starting from a specified top level function, including all its callee functions (recursively).</div><div><br></div><div>     For example, in the following code, I am interested in a command like "extract -top_function blah()" that will create an llvm IR with just blah() and foo().<br></div><div><br></div><div>      int foo() {</div><div>          ...<br></div><div>      }</div><div><br></div><div>       int blah() {</div><div>             foo()</div><div>      
 }</div><div><br></div><div>        int junk() {</div><div>             blah();</div><div>        }</div><div><br></div><div>        int main() {</div><div>             junk();</div><div>        }</div><div><br></div><div>    I can imagine writing some kind of FunctionPass that filters for specified function etc. But is there already some pass/command/tool that already does something similar?</div><div><br></div><div>    Thanks in advance for helping a newbie!</div><div><br></div><div>-Ananth</div></div></div><br><br></div></div></div></div>_______________________________________________<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">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></body></html>