aboutsummaryrefslogtreecommitdiff
path: root/gcc/plugin.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2010-05-25 14:01:45 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2010-05-25 14:01:45 +0100
commita13812e2c83b6cc3fcc324ca3c855af68d31daa6 (patch)
tree013d843f2cba975bbb1d9e3277b722a21d0aec70 /gcc/plugin.c
parent791bddee093414f72f673e0fefb405c8eca32e23 (diff)
downloadgcc-a13812e2c83b6cc3fcc324ca3c855af68d31daa6.zip
gcc-a13812e2c83b6cc3fcc324ca3c855af68d31daa6.tar.gz
gcc-a13812e2c83b6cc3fcc324ca3c855af68d31daa6.tar.bz2
diagnostic.c: Don't include plugin.h.
* diagnostic.c: Don't include plugin.h. (diagnostic_report_diagnostic): Don't handle plugins specially here. Pass context to internal_error callback. * diagnostic.h (struct diagnostic_context): Add context parameter to internal_error callback. * plugin.c (warn_if_plugins, plugins_internal_error_function): New. * plugin.h (struct diagnostic_context): Declare. (warn_if_plugins, plugins_internal_error_function): Declare. * toplev.c (general_init): Set global_dc->internal_error. * Makefile.in (diagnostic.o): Update dependencies. ada: * gcc-interface/misc.c (internal_error_function): Add context parameter. Use it to access show_column flag and instead of using global_dc. Call warn_if_plugins. * gcc-interface/Make-lang.in (ada/misc.o): Update dependencies. From-SVN: r159819
Diffstat (limited to 'gcc/plugin.c')
-rw-r--r--gcc/plugin.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/plugin.c b/gcc/plugin.c
index 707d2dd..1c737a5 100644
--- a/gcc/plugin.c
+++ b/gcc/plugin.c
@@ -810,6 +810,32 @@ 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 (struct 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