This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix plugin callbacks for PLUGIN_FINISH_TYPE


When I renamed PLUGIN_FINISH_STRUCT to PLUGIN_FINISH_TYPE I
inadvertently broke the code.  I had failed to change the test
cases that test for it, so instead of showing up as failed, they
showed up as unresolved, which my comparison scripts were too
dumb to pick up.

In the process of fixing that, I also saw that we are emitting
warning messages about loaded plugins for errors and warnings.
That's not right, since plugins themselves may want to emit error
and warnings.  This was causing failures in the dg-warning
patterns.

The testsuite is still in my local tree, so the patch does not
include the fixes I made to it (it is fixed in the plugins
branch, however).

I've applied this patch as obvious.  Tested on x86_64.



2009-04-14  Diego Novillo  <dnovillo@google.com>

	* diagnostic.c (diagnostic_report_diagnostic): Do not
	warn about loaded plugins for DK_ERROR and DK_WARNING.
	* c-decl.c (declspecs_add_type): Move call to
	invoke_plugin_callbacks ...
	* c-parser.c (c_parser_declspecs): ... here.
	* plugin.c (dump_active_plugins): Tidy output.

cp/ChangeLog

	* parser.c (cp_parser_type_specifier_seq): Move call to
	invoke_plugin_callbacks ...
	(cp_parser_type_specifier_seq): ... here.

Index: diagnostic.c
===================================================================
--- diagnostic.c	(revision 146059)
+++ diagnostic.c	(working copy)
@@ -372,10 +372,7 @@ diagnostic_report_diagnostic (diagnostic

   context->lock++;

-  if ((diagnostic->kind == DK_ERROR
-       || diagnostic->kind == DK_WARNING
-       || diagnostic->kind == DK_ICE)
-      && plugins_active_p ())
+  if (diagnostic->kind == DK_ICE && plugins_active_p ())
     {
       fnotice (stderr, "*** WARNING *** there are active plugins, do
not report"
 	       " this as a bug unless you can reproduce it without enabling"
Index: cp/parser.c
===================================================================
--- cp/parser.c	(revision 146059)
+++ cp/parser.c	(working copy)
@@ -11015,6 +11015,7 @@ cp_parser_type_specifier (cp_parser* par
       cp_parser_parse_tentatively (parser);
       /* Look for the class-specifier.  */
       type_spec = cp_parser_class_specifier (parser);
+      invoke_plugin_callbacks (PLUGIN_FINISH_TYPE, type_spec);
       /* If that worked, we're done.  */
       if (cp_parser_parse_definitely (parser))
 	{
@@ -13891,8 +13892,6 @@ cp_parser_type_specifier_seq (cp_parser*
 	  break;
 	}

-      invoke_plugin_callbacks (PLUGIN_FINISH_TYPE, type_specifier);
-
       seen_type_specifier = true;
       /* The standard says that a condition can be:

Index: c-decl.c
===================================================================
--- c-decl.c	(revision 146059)
+++ c-decl.c	(working copy)
@@ -7262,9 +7262,6 @@ struct c_declspecs *
 declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
 {
   tree type = spec.spec;
-
-  invoke_plugin_callbacks (PLUGIN_FINISH_TYPE, type);
-
   specs->non_sc_seen_p = true;
   specs->declspecs_seen_p = true;
   specs->type_seen_p = true;
Index: plugin.c
===================================================================
--- plugin.c	(revision 146059)
+++ plugin.c	(working copy)
@@ -647,7 +647,7 @@ dump_active_plugins (FILE *file)
   if (!plugins_active_p ())
     return;

-  fprintf (stderr, "Event\t\tPlugins\n");
+  fprintf (stderr, "Event\t\t\tPlugins\n");
   for (event = PLUGIN_PASS_MANAGER_SETUP; event < PLUGIN_EVENT_LAST; event++)
     if (plugin_callbacks[event])
       {
Index: c-parser.c
===================================================================
--- c-parser.c	(revision 146059)
+++ c-parser.c	(working copy)
@@ -1553,6 +1553,7 @@ c_parser_declspecs (c_parser *parser, st
 	  attrs_ok = true;
 	  seen_type = true;
 	  t = c_parser_struct_or_union_specifier (parser);
+          invoke_plugin_callbacks (PLUGIN_FINISH_TYPE, t.spec);
 	  declspecs_add_type (specs, t);
 	  break;
 	case RID_TYPEOF:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]