(no subject)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

Ananth Durbha-2
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

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

extracting sub-program using specified top level function name

Ananth Durbha-2
fixing missing subject line in original email.

----- Forwarded Message -----
From: Ananth Durbha <[hidden email]>
To: llvm list <[hidden email]>
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



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: (no subject)

Gregory Malecha-2
In reply to this post by Ananth Durbha-2
Hi Ananth,

I'm not sure about a tool that already does it, but there is code to construct a callgraph that you could use to write a pass to do this.

On Tue, Aug 9, 2011 at 11:38 PM, Ananth Durbha <[hidden email]> wrote:
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

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




--
gregory malecha


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: extracting sub-program using specified top level function name

Devang Patel
In reply to this post by Ananth Durbha-2
Have you looked at llvm-extract tool ?
-
Devang

On Aug 9, 2011, at 11:40 PM, Ananth Durbha wrote:

fixing missing subject line in original email.

----- Forwarded Message -----
From: Ananth Durbha <[hidden email]>
To: llvm list <[hidden email]>
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


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev