This is the mail archive of the
mailing list for the GCC project.
Re: plugins callbacks and data
- From: Rafael Espindola <espindola at google dot com>
- To: Basile STARYNKEVITCH <basile at starynkevitch dot net>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>, Le-Chun Wu <lcwu at google dot com>
- Date: Tue, 12 May 2009 10:47:42 +0100
- Subject: Re: plugins callbacks and data
- References: <4A093468.firstname.lastname@example.org>
2009/5/12 Basile STARYNKEVITCH <email@example.com>:
> Hello All
> In the current plugin API, the function register_callback is used to
> register callback routines (eg PLUGIN_FINISH_UNIT) in which case the
> callback is expected to be a routine. But this same function
> register_callback is used also to register some data to plugins, without any
> call back functions, eg for PLUGIN_PASS_MANAGER_SETUP.
> Perhaps we could have two different functions:
> 1. Âregister_callback like before for true callbacks
> 2. Âregister_data for registering data, like for PLUGIN_PASS_MANAGER_SETUP
> or PLUGIN_INFO, declared as
> Âvoid register_data (const char *plugin_name,
> Â Â Â Â Â Â Â Â Âenum plugin_event event,,
> Â Â Â Â Â Â Â Â Âvoid* user_data);
> What do you think?
No strong preference one way or the other. One small advantage of the
current model is that we have only switch statement over all "enum
The function already existed when I joined, maybe Le-Chu has some
opinion about your proposal.
Rafael Avila de Espindola
Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047