plugin.c (FMT_FOR_PLUGIN_EVENT): added definition.
authorBasile Starynkevitch <basile@starynkevitch.net>
Thu, 19 Nov 2009 17:21:50 +0000 (17:21 +0000)
committerBasile Starynkevitch <bstarynk@gcc.gnu.org>
Thu, 19 Nov 2009 17:21:50 +0000 (17:21 +0000)
2009-11-19  Basile Starynkevitch  <basile@starynkevitch.net>

* gcc/plugin.c (FMT_FOR_PLUGIN_EVENT): added definition.
(dump_active_plugins): output to file everything. Use
internationalized dump & FMT_FOR_PLUGIN_EVENT.

From-SVN: r154337

gcc/ChangeLog
gcc/plugin.c

index e4923fceb8e70868aa1d21b11adf36cb81962365..5c288a0d671645d59eb05c47a13353c06c269c0e 100644 (file)
@@ -1,3 +1,9 @@
+2009-11-19  Basile Starynkevitch  <basile@starynkevitch.net>
+
+       * plugin.c (FMT_FOR_PLUGIN_EVENT): added definition.
+       (dump_active_plugins): output to file everything. Use
+       internationalized dump & FMT_FOR_PLUGIN_EVENT.
+
 2009-11-19  Richard Guenther  <rguenther@suse.de>
 
        * gimple.c (canonicalize_cond_expr_cond): Strip conversions
index 2d64422787eb43a9fae255175e64af86ec6f993e..bb967c385fe7f304c3330c9da40b610d1b0f12a6 100644 (file)
@@ -64,6 +64,9 @@ const char *plugin_event_name[] =
   "PLUGIN_EVENT_LAST"
 };
 
+/* A printf format large enough for the largest event above.  */
+#define FMT_FOR_PLUGIN_EVENT "%-26s"
+
 /* Hash table for the plugin_name_args objects created during command-line
    parsing.  */
 static htab_t plugin_name_args_tab = NULL;
@@ -637,18 +640,18 @@ dump_active_plugins (FILE *file)
   if (!plugins_active_p ())
     return;
 
-  fprintf (stderr, "Event\t\t\tPlugins\n");
+  fprintf (file, FMT_FOR_PLUGIN_EVENT " | %s\n", _("Event"), _("Plugins"));
   for (event = PLUGIN_PASS_MANAGER_SETUP; event < PLUGIN_EVENT_LAST; event++)
     if (plugin_callbacks[event])
       {
        struct callback_info *ci;
 
-       fprintf (file, "%s\t", plugin_event_name[event]);
+       fprintf (file, FMT_FOR_PLUGIN_EVENT " |", plugin_event_name[event]);
 
        for (ci = plugin_callbacks[event]; ci; ci = ci->next)
-         fprintf (file, "%s ", ci->plugin_name);
+         fprintf (file, " %s", ci->plugin_name);
 
-       fprintf (file, "\n");
+       putc('\n', file);
       }
 }