This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: plugin event for C/C++ declarations


On 4/27/10 15:43 , Brian Hackett wrote:

> Hmm, I don't see a way for this to avoid using a global variable,

I wanted to avoid introducing a *new* one actually.  But I had forgotten
that we don't already have one for -fplugin.

> there's no state saved for whether a plugin has been added that is not
> internal to plugin.c.  The patch below (seems to build, need to test
> regr) adds a flag_plugin_added; alternatively plugin_name_args_tab
> could be extern'ed in plugin.h but there's no reason for anything
> outside plugin.c to access this structure's internals.

OK with the changes Richard suggested for the ChangeLog entry and:


> +/* True iff at least one plugin has been added. */
> +extern bool flag_plugin_added;

Move the declaration inside invoke_plugin_callbacks?  This will at least
prevent other functions outside plugin.c from trying to access it.


Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]