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 Wed, Apr 28, 2010 at 5:48 PM, Brian Hackett <bhackett1024@gmail.com> wrote:
> On Wed, Apr 28, 2010 at 5:46 AM, Diego Novillo <dnovillo@google.com> wrote:
>> 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.
>>
>
> Hi, here is an updated patch incorporating this change. ?For this
> patch 'make bootstrap' works for me on x86_64 linux (plugin support)
> and x86_64 darwin (no plugin support), and the plugin regressions
> pass.
>
> Brian
>
> gcc/ChangeLog: ? Brian Hackett ? <bhackett1024@gmail.com>
>
> ? ? ? ?* plugin.h (invoke_plugin_callbacks): New inline function.
> ? ? ? ?* plugin.c (flag_plugin_added): New global flag.
> ? ? ? ?(add_new_plugin): Initialize above flag.
> ? ? ? ?(invoke_plugin_callbacks): Rename to ...
> ? ? ? ?(invoke_plugin_callbacks_full): ... this.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43936

-- 
H.J.


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