aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorAndres Tiraboschi <andres.tiraboschi@tallertechnologies.com>2015-06-03 13:27:11 +0000
committerJeff Law <law@gcc.gnu.org>2015-06-03 07:27:11 -0600
commitea5b45b61fe6917f59c0cb509fa0af5de08287bf (patch)
tree329fd87cc105897690e082dad29a77825d113933 /gcc/cp
parente004aa11b1d261b597aa3e062204af61762ba6a9 (diff)
downloadgcc-ea5b45b61fe6917f59c0cb509fa0af5de08287bf.zip
gcc-ea5b45b61fe6917f59c0cb509fa0af5de08287bf.tar.gz
gcc-ea5b45b61fe6917f59c0cb509fa0af5de08287bf.tar.bz2
plugins.texi (enum plugin_event): New event.
* doc/plugins.texi (enum plugin_event): New event. * plugin.c (register_callback): Handle PLUGIN_START_PARSE_FUNCTION and PLUGIN_FINISH_FUNCTION. * plugin.def (PLUGIN_START_PARSE_FUNCTION): Add plugin event (PLUGIN_FINISH_PARSE_FUNCTION): Likewise. cp/ * decl.c (start_function): Call plugin before parsing. (finish_function): Call plugin after parsing. c/ * c-decl.c (start_function): Call plugin before parsing. (finish_function): Call plugin after parsing. testsuite/ * g++.dg/plugin/plugin.exp: Add def-plugin-test.C. * g++.dg/plugin/def_plugin.c: New file. * g++.dg/plugin/def-plugin-test.C: New file. From-SVN: r224078
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b6a8ab5..fe1f7bb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
+
+ * decl.c (start_function): Call plugin before parsing.
+ (finish_function): Call plugin after parsing.
+
2015-06-02 Patrick Palka <patrick@parcs.ath.cx>
* cp-tree.h (init_error): Remove declaration.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index a8cb358..6140ab6 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13748,6 +13748,7 @@ start_function (cp_decl_specifier_seq *declspecs,
tree decl1;
decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, &attrs);
+ invoke_plugin_callbacks (PLUGIN_START_PARSE_FUNCTION, decl1);
if (decl1 == error_mark_node)
return false;
/* If the declarator is not suitable for a function definition,
@@ -14386,6 +14387,7 @@ finish_function (int flags)
vec_free (deferred_mark_used_calls);
}
+ invoke_plugin_callbacks (PLUGIN_FINISH_PARSE_FUNCTION, fndecl);
return fndecl;
}