Mercurial > hg > CbC > CbC_gcc
diff gcc/plugin.c @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
line wrap: on
line diff
--- a/gcc/plugin.c Tue May 25 18:58:51 2010 +0900 +++ b/gcc/plugin.c Tue Mar 22 17:18:12 2011 +0900 @@ -22,17 +22,8 @@ #include "config.h" #include "system.h" - -/* If plugin support is not enabled, do not try to execute any code - that may reference libdl. The generic code is still compiled in to - avoid including too many conditional compilation paths in the rest - of the compiler. */ -#ifdef ENABLE_PLUGIN -#include <dlfcn.h> -#endif - #include "coretypes.h" -#include "toplev.h" +#include "diagnostic-core.h" #include "tree.h" #include "tree-pass.h" #include "intl.h" @@ -179,7 +170,7 @@ { plugin = (struct plugin_name_args *) *slot; if (strcmp (plugin->full_name, plugin_name)) - error ("Plugin %s was specified with different paths:\n%s\n%s", + error ("plugin %s was specified with different paths:\n%s\n%s", plugin->base_name, plugin->full_name, plugin_name); return; } @@ -225,7 +216,7 @@ { if (key_parsed) { - error ("Malformed option -fplugin-arg-%s (multiple '=' signs)", + error ("malformed option -fplugin-arg-%s (multiple '=' signs)", arg); return; } @@ -241,7 +232,7 @@ if (!key_start) { - error ("Malformed option -fplugin-arg-%s (missing -<key>[=<value>])", + error ("malformed option -fplugin-arg-%s (missing -<key>[=<value>])", arg); return; } @@ -303,7 +294,7 @@ plugin->argv[plugin->argc - 1].value = value; } else - error ("Plugin %s should be specified before -fplugin-arg-%s " + error ("plugin %s should be specified before -fplugin-arg-%s " "in the command line", name, arg); /* We don't need the plugin's name anymore. Just release it. */ @@ -423,7 +414,7 @@ default: if (event < PLUGIN_EVENT_FIRST_DYNAMIC || event >= event_last) { - error ("Unknown callback event registered by plugin %s", + error ("unknown callback event registered by plugin %s", plugin_name); return; } @@ -451,7 +442,7 @@ struct callback_info *new_callback; if (!callback) { - error ("Plugin %s registered a null callback function " + error ("plugin %s registered a null callback function " "for event %s", plugin_name, plugin_event_name[event]); return; } @@ -571,7 +562,7 @@ dl_handle = dlopen (plugin->full_name, RTLD_NOW | RTLD_GLOBAL); if (!dl_handle) { - error ("Cannot load plugin %s\n%s", plugin->full_name, dlerror ()); + error ("cannot load plugin %s\n%s", plugin->full_name, dlerror ()); return false; } @@ -589,7 +580,7 @@ if ((err = dlerror ()) != NULL) { - error ("Cannot find %s in plugin %s\n%s", str_plugin_init_func_name, + error ("cannot find %s in plugin %s\n%s", str_plugin_init_func_name, plugin->full_name, err); return false; } @@ -597,7 +588,7 @@ /* Call the plugin-provided initialization routine with the arguments. */ if ((*plugin_init) (plugin, &gcc_version)) { - error ("Fail to initialize plugin %s", plugin->full_name); + error ("fail to initialize plugin %s", plugin->full_name); return false; } @@ -778,7 +769,7 @@ /* Dump to FILE the names and associated events for all the active plugins. */ -void +DEBUG_FUNCTION void dump_active_plugins (FILE *file) { int event; @@ -804,12 +795,38 @@ /* Dump active plugins to stderr. */ -void +DEBUG_FUNCTION void debug_active_plugins (void) { dump_active_plugins (stderr); } +/* Give a warning if plugins are present, before an ICE message asking + to submit a bug report. */ + +void +warn_if_plugins (void) +{ + if (plugins_active_p ()) + { + fnotice (stderr, "*** WARNING *** there are active plugins, do not report" + " this as a bug unless you can reproduce it without enabling" + " any plugins.\n"); + dump_active_plugins (stderr); + } + +} + +/* Likewise, as a callback from the diagnostics code. */ + +void +plugins_internal_error_function (diagnostic_context *context ATTRIBUTE_UNUSED, + const char *msgid ATTRIBUTE_UNUSED, + va_list *ap ATTRIBUTE_UNUSED) +{ + warn_if_plugins (); +} + /* The default version check. Compares every field in VERSION. */ bool