<html><body><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></body></html>