diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-29 09:01:56 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-29 09:01:56 +0000 |
commit | a3f551d2aa2897518373ac025e3ebac5284aab36 (patch) | |
tree | c18099c8f924d3a704cd687045a9ca83b40a4f28 /gcc/plugin.c | |
parent | 0cddb138341aafca38ae8d099c98750b5b34b8b2 (diff) | |
download | gcc-a3f551d2aa2897518373ac025e3ebac5284aab36.tar.gz |
2010-04-29 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158896 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/plugin.c')
-rw-r--r-- | gcc/plugin.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/plugin.c b/gcc/plugin.c index 9e1b5f4ada1..707d2dd5f66 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -86,6 +86,8 @@ struct callback_info static struct callback_info *plugin_callbacks_init[PLUGIN_EVENT_FIRST_DYNAMIC]; static struct callback_info **plugin_callbacks = plugin_callbacks_init; +/* For invoke_plugin_callbacks(), see plugin.h. */ +bool flag_plugin_added = false; #ifdef ENABLE_PLUGIN /* Each plugin should define an initialization function with exactly @@ -137,6 +139,8 @@ add_new_plugin (const char* plugin_name) bool name_is_short; const char *pc; + flag_plugin_added = true; + /* Replace short names by their full path when relevant. */ name_is_short = !IS_ABSOLUTE_PATH (plugin_name); for (pc = plugin_name; name_is_short && *pc; pc++) @@ -483,16 +487,11 @@ unregister_callback (const char *plugin_name, int event) return PLUGEVT_NO_CALLBACK; } -/* Called from inside GCC. Invoke all plug-in 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 */ +/* Invoke all plugin callbacks registered with the specified event, + called from invoke_plugin_callbacks(). */ int -invoke_plugin_callbacks (int event, void *gcc_data) +invoke_plugin_callbacks_full (int event, void *gcc_data) { int retval = PLUGEVT_SUCCESS; |