summaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-14 20:18:49 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-14 20:18:49 +0000
commit9227b6fcb5d57341e64daf1dfd153f38df20694c (patch)
treea65b40c88b9169d2d76f8139339fd3054612f224 /gcc/toplev.c
parentf3245e9d4b1285241a39f85498e6f2ddfa3e3ffa (diff)
downloadgcc-9227b6fcb5d57341e64daf1dfd153f38df20694c.tar.gz
2009-04-14 Diego Novillo <dnovillo@google.com>
Le-Chun Wu <lcwu@google.com> * configure.ac: Add --enable-plugin support. Define ENABLE_PLUGIN and PLUGINLIBS when specified. * Makefile.in (PLUGIN_H): Define. Export ENABLE_PLUGIN and GMPINC to site.exp. Add PLUGINLIBS to link command. Add/modify dependencies for plugin.o and files including plugin.h. (plugin.o): New. * config.in: Regenerate. * opts.c (common_handle_option): Handle OPT_fplugin_ and OPT_fplugin_arg_. 2009-04-14 Le-Chun Wu <lcwu@google.com> * tree-pass.h (register_one_dump_file): Add a prototype for register_one_dump_file. * toplev.c (compile_file): Call initialize_plugins. (do_compile): Call invoke_plugin_callbacks. (toplev_main): Call invoke_plugin_callbacks. * common.opt: Add -fplugin= and -fplugin-arg-. * gcc-plugin.h: New public header file for plugins to include. * plugin.c: New source file. * plugin.h: New internal header file. * passes.c (register_one_dump_file): Make it external. * c-parser.c (c_parser_declspecs): Call invoke_plugin_callbacks. 2009-04-14 Diego Novillo <dnovillo@google.com> * doc/plugins.texi: New. * doc/gccint.texi: Add reference to Plugins chapter. * doc/invoke.texi: Document -fplugin and -fplugin-arg * diagnostic.c (diagnostic_report_diagnostic): Warn about loaded plugins, if any. * timevar.def (TV_PLUGIN_INIT): Define. (TV_PLUGIN_RUN): Define. * plugin.c: Include timevar.h (plugins_active_p): New. (dump_active_plugins): New. (debug_active_plugins): New. cp/ChangeLog 2009-04-14 Le-Chun Wu <lcwu@google.com> * Make-lang.in: Modify dependencies of files including plugin.h. * decl.c (finish_function): Call invoke_plugin_callbacks. * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146059 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index fe4768df121..675cdf249cf 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -85,6 +85,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "gimple.h"
#include "tree-ssa-alias.h"
+#include "plugin.h"
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
@@ -968,6 +969,7 @@ compile_file (void)
init_final (main_input_filename);
coverage_init (aux_base_name);
statistics_init ();
+ initialize_plugins ();
timevar_push (TV_PARSE);
@@ -2241,6 +2243,9 @@ do_compile (void)
compile_file ();
finalize ();
+
+ /* Invoke registered plugin callbacks. */
+ invoke_plugin_callbacks (PLUGIN_FINISH_UNIT, NULL);
}
/* Stop timing and print the times. */
@@ -2275,6 +2280,9 @@ toplev_main (unsigned int argc, const char **argv)
if (warningcount || errorcount)
print_ignored_options ();
+ /* Invoke registered plugin callbacks if any. */
+ invoke_plugin_callbacks (PLUGIN_FINISH, NULL);
+
if (errorcount || sorrycount)
return (FATAL_EXIT_CODE);