On Mon, Feb 23, 2009 at 22:04, Le-Chun Wu <lcwu@google.com> wrote:
2009-02-23 Le-Chun Wu <lcwu@google.com>
* configure.ac: Add --enalbe-plugin support. Set pluginlibs only for
ELF targets.
* configure: Regenerate.
* Makefile.tpl: Define and export PLUGINLIBS.
* Makefile.in: Regenerate.
* gcc/configure.ac: Add PLUGINLIBS variable.
* gcc/configure: Regenerate.
* gcc/Makefile.in: Add PLUGINLIBS to link command. Add/modify dependencies
for plugin.o and files including plugin.h.
* gcc/tree-pass.h (register_one_dump_file): Add a prototype for
register_one_dump_file.
* gcc/toplev.c (compile_file): Call initialize_plugins.
(do_compile): Call invoke_plugin_callbacks.
(toplev_main): Call invoke_plugin_callbacks.
* gcc/cp/decl.c (finish_function): Call invoke_plugin_callbacks.
* gcc/cp/parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
* gcc/cp/Make-lang.in: Modify dependencies of files including plugin.h.
* gcc/opts.c (common_handle_option): Handle OPT_fplugin_ and
OPT_fplugin_arg_.
* gcc/common.opt: Add -fplugin= and -fplugin-arg-.
* gcc/gcc-plugin.h: New public header file for plugins to include.
* gcc/plugin.c: New source file.
* gcc/plugin.h: New internal header file.
* gcc/passes.c (register_one_dump_file): Make it external.
* gcc/c-parser.c (c_parser_declspecs): Call invoke_plugin_callbacks.
Thanks for doing this. The patch looks fine in general and it's
OK to commit to the plugins branch with the revisions below.
There are some items that could be addressed in subsequent
patches:
- Need to have pre/post checks at the point of plugin insertion.
- Should we have configurable plugin insertion points? I think
that's too error prone, though.
- The API should be documented in the internals manual. I
suggest adding a new file doc/plugin.texi linked from
gccint.texi.
===================================================================
--- gcc/toplev.c (revision 144307)
+++ gcc/toplev.c (working copy)
@@ -84,6 +84,7 @@ along with GCC; see the file COPYING3.
#include "tree-mudflap.h"
#include "tree-pass.h"
#include "gimple.h"