[LLVMdev] extracting sub-program using specified top level function name

Ananth Durbha avdurbha at yahoo.com
Tue Aug 9 23:40:46 PDT 2011


fixing missing subject line in original email.

----- Forwarded Message -----
From: Ananth Durbha <avdurbha at yahoo.com>
To: llvm list <llvmdev at cs.uiuc.edu>
Sent: Tuesday, August 9, 2011 11:38 PM
Subject: 


Hi,
     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).

     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().


      int foo() {
          ...

      }

       int blah() {
             foo()
       }

        int junk() {
             blah();
        }

        int main() {
             junk();
        }

    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?

    Thanks in advance for helping a newbie!

-Ananth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110809/71924752/attachment.html>


More information about the llvm-dev mailing list