This is the mail archive of the
mailing list for the GCC project.
Re: Retrieve GENERIC function body in plugin
- From: Peter Colberg <peter at colberg dot org>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 24 Oct 2012 17:30:08 -0400
- Subject: Re: Retrieve GENERIC function body in plugin
- References: <20121024165523.GA3486@alcyone>
On Wed, Oct 24, 2012 at 12:55:23PM -0400, Peter Colberg wrote:
> The plugin registers a callback to PLUGIN_FINISH_UNIT, and therein
> retrieves function_decl nodes of the current translation unit by
> iterating over cgraph_nodes. However, getting the function body
> using DECL_SAVED_TREE(node) always returns NULL.
Never mind, I figured out a solution. One may register a callback
for PLUGIN_PRE_GENERICIZE, which receives a function declaration
as the first argument. This declaration contains the body.