summaryrefslogtreecommitdiff
path: root/gcc/plugin.c
diff options
context:
space:
mode:
authorBrian Hackett <bhackett1024@gmail.com>2010-04-29 09:01:56 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-04-29 09:01:56 +0000
commitefda38075b9e028be7e6b99c0632c5bbb27a799b (patch)
treec18099c8f924d3a704cd687045a9ca83b40a4f28 /gcc/plugin.c
parent2942c502ee147819b7e57dca78f7a2cf4831279f (diff)
downloadgcc-efda38075b9e028be7e6b99c0632c5bbb27a799b.tar.gz
plugin.h (invoke_plugin_callbacks): New inline function.
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. From-SVN: r158896
Diffstat (limited to 'gcc/plugin.c')
-rw-r--r--gcc/plugin.c15
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;