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]

Re: [plugins] [patch] Initial implementation of GCC plugin support


Diego Novillo wrote:
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"
Just wanted to make a comment on the register_pass and position_pass stuff. The code is based on the code I wrote. Since writing it, I realized that it was a mistake to put it in the plugin part of GCC as that code needed a fair bit of fixing over time(and will probably need more). The pass insertion stuff should be done in the plugins themselves.

Taras


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