summaryrefslogtreecommitdiff
path: root/gcc/gcc-plugin.h
diff options
context:
space:
mode:
authorespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-16 13:12:20 +0000
committerespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-16 13:12:20 +0000
commite16288b4a39e53823d38ca7b17f97be364101d55 (patch)
tree4c2c486bde5f48e09fd4e0030c18e8c61a2c68a1 /gcc/gcc-plugin.h
parent4991732ef6df19d9c2699be3580e9f139e6e6775 (diff)
downloadgcc-e16288b4a39e53823d38ca7b17f97be364101d55.tar.gz
2009-04-16 Rafael Avila de Espindola <espindola@google.com>
* gcc-plugin.h (plugin_event): Add PLUGIN_INFO. (plugin_info): New. * opts.c (common_handle_option): Don't call print_version. * plugin.c (plugin_name_args): Add version. (register_plugin_info): New. (register_callback): Handle PLUGIN_INFO. (try_init_one_plugin): New. (init_one_plugin): Use try_init_one_plugin. Only free plugin_name_args if failed to init. (finalize_one_plugin): New. (finalize_plugins): New. (print_one_plugin): New. (print_plugins_versions): New. * plugin.h (print_plugins_versions): New. (finalize_plugins): New. * toplev.c (compile_file): Don't call initialize_plugins. (print_version): Call print_plugins_versions. (toplev_main): Call initialize_plugins. Print version if needed. Call finalize_plugins. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146187 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc-plugin.h')
-rw-r--r--gcc/gcc-plugin.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/gcc-plugin.h b/gcc/gcc-plugin.h
index 4a45c1e2c48..8627720acd2 100644
--- a/gcc/gcc-plugin.h
+++ b/gcc/gcc-plugin.h
@@ -28,6 +28,7 @@ enum plugin_event
PLUGIN_FINISH_UNIT, /* Useful for summary processing. */
PLUGIN_CXX_CP_PRE_GENERICIZE, /* Allows to see low level AST in C++ FE. */
PLUGIN_FINISH, /* Called before GCC exits. */
+ PLUGIN_INFO, /* Information about the plugin */
PLUGIN_EVENT_LAST /* Dummy event used for indexing callback
array. */
};
@@ -58,6 +59,13 @@ struct plugin_pass
enum pass_positioning_ops pos_op; /* how to insert the new pass. */
};
+/* Additional information about the plugin. Used by --help and --version. */
+
+struct plugin_info
+{
+ const char *version;
+};
+
/* Function type for the plugin initialization routine. Each plugin module
should define this as an externally-visible function with name
"plugin_init."