This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: the interface for cloning function
- From: Martin Jambor <mjambor at suse dot cz>
- To: Feng LI <nemokingdom at gmail dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Fri, 17 Jun 2011 00:13:16 +0200
- Subject: Re: the interface for cloning function
- References: <BANLkTimv7Eo9NqJ3E5EZ-gXYDW8=xg-tow@mail.gmail.com>
Hi,
On Wed, Jun 15, 2011 at 07:20:47PM +0200, Feng LI wrote:
> Hi,
>
> Is there an interface provided in GCC to clone the current function?
> I searched in the source code but failed, just in case I'm going wrong.
>
There are at least two. If you want to clone from within an ordinary
intra-procedural pass (as presented to our pass manager), you are
probably after cgraph_function_versioning. If, on the other hand you
want to make clones in an inter-procedural stage of an IPA pass, you
probably want cgraph_create_virtual_clone.
HTH
Martin