aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.c
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/c/c-decl.c
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/c/c-decl.c')
-rw-r--r--gcc/c/c-decl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 68c79df..efdf902 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -8239,6 +8239,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, true, NULL,
&attributes, NULL, NULL, DEPRECATED_NORMAL);
+ invoke_plugin_callbacks (PLUGIN_START_PARSE_FUNCTION, decl1);
/* If the declarator is not suitable for a function definition,
cause a syntax error. */
@@ -9083,6 +9084,7 @@ finish_function (void)
It's still in DECL_STRUCT_FUNCTION, and we'll restore it in
tree_rest_of_compilation. */
set_cfun (NULL);
+ invoke_plugin_callbacks (PLUGIN_FINISH_PARSE_FUNCTION, current_function_decl);
current_function_decl = NULL;
}