public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ Plugins
@ 2009-10-11 16:21 Terrence Miller
  2009-10-19 19:48 ` Benjamin Smedberg
  0 siblings, 1 reply; 3+ messages in thread
From: Terrence Miller @ 2009-10-11 16:21 UTC (permalink / raw)
  To: gcc

(Version 4.5.0)

There are plugin callbacks which trigger at the end of processing types 
and C++ functions,
but I can not find a clean way for plugin code to notice a top-level 
variable declaration.

I'm hoping that the answer does not require the plugin shared library to
bind to global symbols of the compiler (i.e. global_namespace).


     TIA - Terrence Miller

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: C++ Plugins
  2009-10-11 16:21 C++ Plugins Terrence Miller
@ 2009-10-19 19:48 ` Benjamin Smedberg
  2009-10-19 21:53   ` Terrence Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Smedberg @ 2009-10-19 19:48 UTC (permalink / raw)
  To: Terrence Miller; +Cc: gcc

On 10/11/09 12:13 PM, Terrence Miller wrote:
> (Version 4.5.0)
> 
> There are plugin callbacks which trigger at the end of processing types
> and C++ functions,
> but I can not find a clean way for plugin code to notice a top-level
> variable declaration.
> 
> I'm hoping that the answer does not require the plugin shared library to
> bind to global symbols of the compiler (i.e. global_namespace).

Why not? That's what dehydra does: it enumerates through the items in
global_namespace in PLUGIN_FINISH_UNIT.

--BDS

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: C++ Plugins
  2009-10-19 19:48 ` Benjamin Smedberg
@ 2009-10-19 21:53   ` Terrence Miller
  0 siblings, 0 replies; 3+ messages in thread
From: Terrence Miller @ 2009-10-19 21:53 UTC (permalink / raw)
  To: Benjamin Smedberg; +Cc: gcc

<response at end>
Benjamin Smedberg wrote:
> On 10/11/09 12:13 PM, Terrence Miller wrote:
>   
>> (Version 4.5.0)
>>
>> There are plugin callbacks which trigger at the end of processing types
>> and C++ functions,
>> but I can not find a clean way for plugin code to notice a top-level
>> variable declaration.
>>
>> I'm hoping that the answer does not require the plugin shared library to
>> bind to global symbols of the compiler (i.e. global_namespace).
>>     
> Why not? That's what dehydra does: it enumerates through the items in
> global_namespace in PLUGIN_FINISH_UNIT.
>
> --BDS
>   
Because it makes the name "global_namespace" and the list 
order(TREE_CHAIN (t) points  to  a declaration
located earlier in the file than t) be part of the plugin interface and 
these two items are not documented.  Also
you end up with one way of handling top-level types (PLUGIN_FINISH_TYPE) 
and functions
(PLUGIN_CXX_CP_PRE_GENERICIZE) and a different way of handling 
variables.  A better scheme (IMO)
would be to have a plugin triggered when the declaration of a variable 
is complete and another pair of plugins
for scope entry/exit.


           Terrence


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-19 19:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-11 16:21 C++ Plugins Terrence Miller
2009-10-19 19:48 ` Benjamin Smedberg
2009-10-19 21:53   ` Terrence Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).