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 Tue, 27 Apr 2010, Diego Novillo wrote:

> On Tue, Apr 27, 2010 at 11:46, Richard Guenther <rguenther@suse.de> wrote:
> > On Tue, 27 Apr 2010, Brian Hackett wrote:
> >
> >> I'll put together a patch using an inline function which checks a
> >> plugin_loaded_p.
> >
> > Thanks. ÂIt should also be completely optimized out if
> > ENABLE_PLUGIN is not #defined. ÂI see it is currently not, ugh.
> 
> Good idea.  That would completely remove all plugin-related predicates
> from common code paths.
> 
> Just to be clear, you're thinking of this?
> 
> #if defined ENABLE_PLUGIN
> static inline bool plugin_enabled_p() { return flag_plugin<sp?>; }
> #else
> static inline bool plugin_enabled_p() { return false; }
> #endif

Yes, preferably not as a function but a global variable directly.

static inline int invoke_plugin_callbacks(...)
{ if (plugin_enabled_p ()) return invoke_plugin_callbacks_1 (...);
  else reuturn ???;
 }

plugin.c seems to use its internal plugin_name_args_tab as flag.

Richard.

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