aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorRafael Avila de Espindola <espindola@google.com>2009-04-16 13:12:20 +0000
committerRafael Espindola <espindola@gcc.gnu.org>2009-04-16 13:12:20 +0000
commit44e9f0067860f38c31869181263a395ab43981d7 (patch)
tree4c2c486bde5f48e09fd4e0030c18e8c61a2c68a1 /gcc/toplev.c
parentc1c5e0faa84bd01c866f7f2930cc628a770b3c2a (diff)
downloadgcc-44e9f0067860f38c31869181263a395ab43981d7.zip
gcc-44e9f0067860f38c31869181263a395ab43981d7.tar.gz
gcc-44e9f0067860f38c31869181263a395ab43981d7.tar.bz2
gcc-plugin.h (plugin_event): Add PLUGIN_INFO.
2009-04-16 Rafael Avila de Espindola <espindola@google.com> * gcc-plugin.h (plugin_event): Add PLUGIN_INFO. (plugin_info): New. * opts.c (common_handle_option): Don't call print_version. * plugin.c (plugin_name_args): Add version. (register_plugin_info): New. (register_callback): Handle PLUGIN_INFO. (try_init_one_plugin): New. (init_one_plugin): Use try_init_one_plugin. Only free plugin_name_args if failed to init. (finalize_one_plugin): New. (finalize_plugins): New. (print_one_plugin): New. (print_plugins_versions): New. * plugin.h (print_plugins_versions): New. (finalize_plugins): New. * toplev.c (compile_file): Don't call initialize_plugins. (print_version): Call print_plugins_versions. (toplev_main): Call initialize_plugins. Print version if needed. Call finalize_plugins. From-SVN: r146187
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 675cdf2..725c376 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -969,7 +969,6 @@ compile_file (void)
init_final (main_input_filename);
coverage_init (aux_base_name);
statistics_init ();
- initialize_plugins ();
timevar_push (TV_PARSE);
@@ -1164,6 +1163,8 @@ print_version (FILE *file, const char *indent)
file == stderr ? _(fmt4) : fmt4,
indent, *indent != 0 ? " " : "",
PARAM_VALUE (GGC_MIN_EXPAND), PARAM_VALUE (GGC_MIN_HEAPSIZE));
+
+ print_plugins_versions (file, indent);
}
#ifdef ASM_COMMENT_START
@@ -2273,6 +2274,11 @@ toplev_main (unsigned int argc, const char **argv)
init_local_tick ();
+ initialize_plugins ();
+
+ if (version_flag)
+ print_version (stderr, "");
+
/* Exit early if we can (e.g. -help). */
if (!exit_after_options)
do_compile ();
@@ -2283,6 +2289,7 @@ toplev_main (unsigned int argc, const char **argv)
/* Invoke registered plugin callbacks if any. */
invoke_plugin_callbacks (PLUGIN_FINISH, NULL);
+ finalize_plugins ();
if (errorcount || sorrycount)
return (FATAL_EXIT_CODE);