Dictating location/order of gcc plugin

Sandeep K Chaudhary babbusandy2006@gmail.com
Tue May 20 23:41:00 GMT 2014


I figured it out. In case of plugins, we choose the reference pass
when we fill the 'register_pass_info' structure. This structure is
defined in tree-pass.h. The member 'reference_pass_name' is the field
using which we choose the reference pass to hook our plugin to. When
we register the plugin using 'register_callback' during the plugin
init, it calls the pass registration function register_pass which
completes the registration. Thus, we can choose the location/order of
the plugin in the plugin itself.

For gcc passes and their order, one can look at passes.c and figure it out.

Thanks and regards,
Sandeep.

On Tue, May 20, 2014 at 6:48 PM, Sandeep K Chaudhary
<babbusandy2006@gmail.com> wrote:
> Hi guys,
>
> I wrote a custom GIMPLE pass which I invoke as
>
> "g++ -fplugin=/home/sandeep/myplugin/gimple/plugin.so -O1 -c test.c"
>
> Using "-fdump-passes" option, I can see that my pass gets invoked
> after 'tree-ssa' pass.
>
> How can I dictate the location where the plugin is inserted when all
> the passes are called?
>
> I looked at the opt_pass structure but I did't see any relevant member
> for the plugin location/order.
>
> Kindly help me with this. If I can get this working, I think I can
> solve the problem I have had for 4-months with the help of ipa_pass
> but I need to able to dictate the placement of the plugin either
> through source or command.
>
> Thanks and regards,
> Sandeep.



-- 
Thanks and regards,
Sandeep K Chaudhary.



More information about the Gcc-help mailing list