Mercurial > hg > CbC > CbC_gcc
diff gcc/plugin.h @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
line wrap: on
line diff
--- a/gcc/plugin.h Fri Feb 12 23:41:23 2010 +0900 +++ b/gcc/plugin.h Mon May 24 12:47:05 2010 +0900 @@ -1,5 +1,5 @@ /* Header file for internal GCC plugin mechanism. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -26,7 +26,7 @@ extern void add_new_plugin (const char *); extern void parse_plugin_arg_opt (const char *); -extern int invoke_plugin_callbacks (int, void *); +extern int invoke_plugin_callbacks_full (int, void *); extern void initialize_plugins (void); extern bool plugins_active_p (void); extern void dump_active_plugins (FILE *); @@ -35,6 +35,29 @@ extern void print_plugins_help (FILE *file, const char *indent); extern void finalize_plugins (void); +extern bool flag_plugin_added; + +/* Called from inside GCC. Invoke all plugin callbacks registered with + the specified event. + Return PLUGEVT_SUCCESS if at least one callback was called, + PLUGEVT_NO_CALLBACK if there was no callback. + + EVENT - the event identifier + GCC_DATA - event-specific data provided by the compiler */ + +static inline int +invoke_plugin_callbacks (int event ATTRIBUTE_UNUSED, + void *gcc_data ATTRIBUTE_UNUSED) +{ +#ifdef ENABLE_PLUGIN + /* True iff at least one plugin has been added. */ + if (flag_plugin_added) + return invoke_plugin_callbacks_full (event, gcc_data); +#endif + + return PLUGEVT_NO_CALLBACK; +} + /* In attribs.c. */ extern void register_attribute (const struct attribute_spec *attr);