This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[plugins] RFA: Merge plugins into mainline [2/5 - C++ FE]
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org, Le-Chun Wu <lcwu at google dot com>
- Cc: jason at redhat dot com, mark at codesourcery dot com
- Date: Thu, 2 Apr 2009 12:17:56 -0400
- Subject: [plugins] RFA: Merge plugins into mainline [2/5 - C++ FE]
Part 2 of plugins merge. Hooks for the C++ FE to enable plugins.
See http://gcc.gnu.org/ml/gcc-patches/2009-04/msg00186.html for
an overal description of the merge.
Diego.
2009-04-02 Le-Chun Wu <lcwu@google.com>
* decl.c (finish_function): Call invoke_plugin_callbacks.
* parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
Index: gcc/cp/decl.c
===================================================================
--- gcc/cp/decl.c (.../trunk) (revision 145344)
+++ gcc/cp/decl.c (.../branches/plugins) (revision 145453)
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3.
#include "timevar.h"
#include "tree-flow.h"
#include "pointer-set.h"
+#include "plugin.h"
static tree grokparms (tree parmlist, tree *);
static const char *redeclaration_error_message (tree, tree);
@@ -12338,6 +12339,8 @@ finish_function (int flags)
if (!processing_template_decl)
{
struct language_function *f = DECL_SAVED_FUNCTION_DATA (fndecl);
+ /* Invoke registered plugin callbacks if any. */
+ invoke_plugin_callbacks (PLUGIN_CXX_CP_PRE_GENERICIZE, fndecl);
cp_genericize (fndecl);
/* Clear out the bits we don't need. */
f->x_current_class_ptr = NULL;
Index: gcc/cp/parser.c
===================================================================
--- gcc/cp/parser.c (.../trunk) (revision 145344)
+++ gcc/cp/parser.c (.../branches/plugins) (revision 145453)
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3.
#include "target.h"
#include "cgraph.h"
#include "c-common.h"
+#include "plugin.h"
/* The lexer. */
@@ -11006,6 +11007,8 @@ cp_parser_type_specifier (cp_parser* par
cp_parser_parse_tentatively (parser);
/* Look for the class-specifier. */
type_spec = cp_parser_class_specifier (parser);
+ /* Invoke registered plugin callbacks if any. */
+ invoke_plugin_callbacks (PLUGIN_FINISH_STRUCT, type_spec);
/* If that worked, we're done. */
if (cp_parser_parse_definitely (parser))
{