diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-12-01 19:12:29 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-12-01 19:12:29 +0000 |
commit | c9036234fbf4b8b9c2b26ea3ba46e3bacd6d46fa (patch) | |
tree | 5cb060dd65f054dc0a5dfd551c6f71e558fcdb9f /gcc/plugin.def | |
parent | 0ecda2ba70d65b613978d57e912b26617a6ee46d (diff) | |
download | gcc-c9036234fbf4b8b9c2b26ea3ba46e3bacd6d46fa.tar.gz |
2009-12-01 Grigori Fursin <grigori.fursin@inria.fr>
Joern Rennecke <amylaar@spamcop.net>
* cgraphunit.c (plugin.h): Include.
(ipa_passes): Invoke PLUGIN_ALL_IPA_PASSES_START /
PLUGIN_ALL_IPA_PASSES_END at start / end of processing.
* gcc-plugin.h (highlev-plugin-common.h, hashtab.h): Include.
(enum plugin_event): Define by including plugin.def.
Last enumerator is now called PLUGIN_EVENT_FIRST_DYNAMIC.
(plugin_event_name): Change type to const char **.
(get_event_last, get_named_event_id, unregister_callback): Declare.
(register_callback): Change type of event argument to int.
(highlev-plugin-common.h): New file.
* Makefile.in (GCC_PLUGIN_H): Add highlev-plugin-common.h and
$(HASHTAB_H)
(tree-optimize.o passes.o): Depend on $(PLUGIN_H).
(PLUGIN_HEADERS): Add opts.h, $(PARAMS_H) and plugin.def.
(s-header-vars): New rule.
(install-plugin): Depend on s-header-vars. Install b-header-vars.
* params.c (get_num_compiler_params): New function.
* params.h (get_num_compiler_params): Declare.
* passes.c (plugin.h): Include.
(make_pass_instance): Invoke PLUGIN_NEW_PASS.
(do_per_function_toporder, pass_init_dump_file): No longer static.
(pass_fini_dump_file): Likewise.
(execute_one_pass): Likewise. Invoke PLUGIN_OVERRIDE_GATE and
PLUGIN_PASS_EXECUTION.
(execute_ipa_pass_list): Invoke PLUGIN_EARLY_GIMPLE_PASSES_START and
PLUGIN_EARLY_GIMPLE_PASSES_END.
* plugin.c (plugin_event_name_init): New array, defined by
including plugin.def.
(FMT_FOR_PLUGIN_EVENT): Update.
(plugin_event_name): Change type to const char ** and initialize
to plugin_event_name_init.
(event_tab, event_last, event_horizon): New variable.
(get_event_last): New function.
(plugin_callbacks_init): New array.
(plugin_callbacks: Change type to struct callback_info **.
Initialize to plugin_callbacks_init.
(htab_event_eq, get_named_event_id, unregister_callback): New function.
(invoke_plugin_va_callbacks): Likewise.
(register_callback): Change type of event argument to int.
Handle new events. Allow dynamic events.
(invoke_plugin_callbacks): Likewise. Return success status.
(plugins_active_p): Allow dynamic callbacks.
* plugin.def: New file.
* plugin.h (invoke_plugin_callbacks): Update prototype.
(invoke_plugin_va_callbacks): Declare.
* tree-optimize.c (plugin.h): Include.
(tree_rest_of_compilation): Invoke PLUGIN_ALL_PASSES_START and
PLUGIN_ALL_PASSES_END.
* tree-pass.h (execute_one_pass, pass_init_dump_file): Declare.
(pass_fini_dump_file, do_per_function_toporder): Likewise.
* doc/plugin.texi: Document new event types.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154877 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/plugin.def')
-rw-r--r-- | gcc/plugin.def | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/gcc/plugin.def b/gcc/plugin.def new file mode 100644 index 00000000000..b4e541e3c17 --- /dev/null +++ b/gcc/plugin.def @@ -0,0 +1,94 @@ +/* This file contains the definitions for plugin events in GCC. + Copyright (C) 2009 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + + +/* To hook into pass manager. */ +DEFEVENT (PLUGIN_PASS_MANAGER_SETUP) + +/* After finishing parsing a type. */ +DEFEVENT (PLUGIN_FINISH_TYPE) + +/* Useful for summary processing. */ +DEFEVENT (PLUGIN_FINISH_UNIT) + +/* Allows to see low level AST in C++ FE. */ +DEFEVENT (PLUGIN_CXX_CP_PRE_GENERICIZE) + +/* Called before GCC exits. */ +DEFEVENT (PLUGIN_FINISH) + +/* Information about the plugin. */ +DEFEVENT (PLUGIN_INFO) + +/* Called at start of GCC Garbage Collection. */ +DEFEVENT (PLUGIN_GGC_START) + +/* Extend the GGC marking. */ +DEFEVENT (PLUGIN_GGC_MARKING) + +/* Called at end of GGC. */ +DEFEVENT (PLUGIN_GGC_END) + +/* Register an extra GGC root table. */ +DEFEVENT (PLUGIN_REGISTER_GGC_ROOTS) + +/* Register an extra GGC cache table. */ +DEFEVENT (PLUGIN_REGISTER_GGC_CACHES) + +/* Called during attribute registration. */ +DEFEVENT (PLUGIN_ATTRIBUTES) + +/* Called before processing a translation unit. */ +DEFEVENT (PLUGIN_START_UNIT) + +/* Called during pragma registration. */ +DEFEVENT (PLUGIN_PRAGMAS) + +/* Called before first pass from all_passes. */ +DEFEVENT (PLUGIN_ALL_PASSES_START) + +/* Called after last pass from all_passes. */ +DEFEVENT (PLUGIN_ALL_PASSES_END) + +/* Called before first ipa pass. */ +DEFEVENT (PLUGIN_ALL_IPA_PASSES_START) + +/* Called after last ipa pass. */ +DEFEVENT (PLUGIN_ALL_IPA_PASSES_END) + +/* Allows to override pass gate decision for current_pass. */ +DEFEVENT (PLUGIN_OVERRIDE_GATE) + +/* Called before executing a pass. */ +DEFEVENT (PLUGIN_PASS_EXECUTION) + +/* Called before executing subpasses of a GIMPLE_PASS in + execute_ipa_pass_list. */ +DEFEVENT (PLUGIN_EARLY_GIMPLE_PASSES_START) + +/* Called after executing subpasses of a GIMPLE_PASS in + execute_ipa_pass_list. */ +DEFEVENT (PLUGIN_EARLY_GIMPLE_PASSES_END) + +/* Called when a pass is first instantiated. */ +DEFEVENT (PLUGIN_NEW_PASS) + +/* After the hard-coded events above, plugins can dynamically allocate events + at run time. + PLUGIN_EVENT_FIRST_DYNAMIC only appears as last enum element. */ |