aboutsummaryrefslogtreecommitdiff
path: root/gcc/plugin.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2009-05-07 15:54:39 +0000
committerDiego Novillo <dnovillo@google.com>2009-05-07 15:54:39 +0000
commit9f1a3e557f0d524526126554526cf6522395307f (patch)
treee5e59c8cc7b3f00c12d7e7cf54fbb13917f4fcc9 /gcc/plugin.c
parent2d7cbd5500a988688da39f5f46c67abb68fa2ec2 (diff)
* lto-cgraph.c (input_edge): Add type casts for C++ warnings.
(input_cgraph_1): Likewise. * lto-function-in.c (input_real): Likewise. (process_tree_flags): Define ADD_TLS_FLAG. (lto_static_init_local): Likewise. (input_field_decl): Add type casts for C++ warnings. (input_const_decl): Likewise. (input_function_decl): Likewise. (input_var_decl): Likewise. (input_parm_decl): Likewise. (input_result_decl): Likewise. (input_type_decl): Likewise. (input_label_decl): Likewise. (input_type): Likewise. * lto-function-out.c (expr_to_tag): Change type to enum LTO_tags. (output_tree_flags): Define ADD_TLS_FLAG. (lto_debug_tree_flags): Likewise. * lto-section-out.c (get_ref_idx_for): If -funsigned-char is given, replace T with unsigned_char_type_node. * lto-tree-flags.def: Call ADD_TLS_FLAG instead of ADD_VIS_FLAG_SIZE for field tls_model. * ipa-pure-const.c (read_summary): Handle new fields state_previously_known and looping_previously_known. Handle field can_throw. (write_summary): Likewise. Mainline merge @147098. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@147246 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/plugin.c')
-rw-r--r--gcc/plugin.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/gcc/plugin.c b/gcc/plugin.c
index f64c5493285..47d48430f07 100644
--- a/gcc/plugin.c
+++ b/gcc/plugin.c
@@ -38,6 +38,9 @@ along with GCC; see the file COPYING3. If not see
#include "intl.h"
#include "plugin.h"
#include "timevar.h"
+#ifdef ENABLE_PLUGIN
+#include "plugin-version.h"
+#endif
/* Event names as strings. Keep in sync with enum plugin_event. */
const char *plugin_event_name[] =
@@ -99,7 +102,6 @@ static struct pass_list_node *prev_added_pass_node;
/* Each plugin should define an initialization function with exactly
this name. */
static const char *str_plugin_init_func_name = "plugin_init";
-static const char *str_plugin_gcc_version_name = "plugin_gcc_version";
#endif
/* Helper function for the hash table that compares the base_name of the
@@ -569,10 +571,8 @@ try_init_one_plugin (struct plugin_name_args *plugin)
{
void *dl_handle;
plugin_init_func plugin_init;
- struct plugin_gcc_version *version;
char *err;
PTR_UNION_TYPE (plugin_init_func) plugin_init_union;
- PTR_UNION_TYPE (struct plugin_gcc_version*) version_union;
dl_handle = dlopen (plugin->full_name, RTLD_NOW);
if (!dl_handle)
@@ -595,12 +595,9 @@ try_init_one_plugin (struct plugin_name_args *plugin)
return false;
}
- PTR_UNION_AS_VOID_PTR (version_union) =
- dlsym (dl_handle, str_plugin_gcc_version_name);
- version = PTR_UNION_AS_CAST_PTR (version_union);
-
/* Call the plugin-provided initialization routine with the arguments. */
- if ((*plugin_init) (plugin->base_name, version, plugin->argc, plugin->argv))
+ if ((*plugin_init) (plugin->base_name, &gcc_version, plugin->argc,
+ plugin->argv))
{
error ("Fail to initialize plugin %s", plugin->full_name);
return false;
@@ -818,22 +815,23 @@ debug_active_plugins (void)
/* The default version check. Compares every field in VERSION. */
bool
-plugin_default_version_check(struct plugin_gcc_version *version)
+plugin_default_version_check (struct plugin_gcc_version *gcc_version,
+ struct plugin_gcc_version *plugin_version)
{
/* version is NULL if the plugin was not linked with plugin-version.o */
- if (!version)
+ if (!gcc_version || !plugin_version)
return false;
- if (strcmp (version->basever, plugin_gcc_version.basever))
+ if (strcmp (gcc_version->basever, plugin_version->basever))
return false;
- if (strcmp (version->datestamp, plugin_gcc_version.datestamp))
+ if (strcmp (gcc_version->datestamp, plugin_version->datestamp))
return false;
- if (strcmp (version->devphase, plugin_gcc_version.devphase))
+ if (strcmp (gcc_version->devphase, plugin_version->devphase))
return false;
- if (strcmp (version->revision, plugin_gcc_version.revision))
+ if (strcmp (gcc_version->revision, plugin_version->revision))
return false;
- if (strcmp (version->configuration_arguments,
- plugin_gcc_version.configuration_arguments))
+ if (strcmp (gcc_version->configuration_arguments,
+ plugin_version->configuration_arguments))
return false;
return true;
}