mirror of git://gcc.gnu.org/git/gcc.git
[multiple changes]
2009-11-19 Rafael Avila de Espindola <espindola@google.com> * g++.dg/plugin/selfassign.c: Include plugin-version.h. (plugin_init): Pass correct version to plugin_default_version_check. * gcc.dg/plugin/ggcplug.c: Include plugin-version.h. (plugin_init): Pass correct version to plugin_default_version_check. * gcc.dg/plugin/selfassign.c: Include plugin-version.h. (plugin_init): Pass correct version to plugin_default_version_check. 2009-11-19 Basile Starynkevitch <basile@starynkevitch.net> Rafael Avila de Espindola <espindola@google.com> * doc/plugins.texi (Plugin initialization): Added advices for retrieving the version of GCC at plugin compilation and loading times. From-SVN: r154342
This commit is contained in:
parent
bf4967a1bd
commit
e4d5031cc8
|
@ -1,3 +1,10 @@
|
||||||
|
2009-11-19 Basile Starynkevitch <basile@starynkevitch.net>
|
||||||
|
Rafael Avila de Espindola <espindola@google.com>
|
||||||
|
|
||||||
|
* doc/plugins.texi (Plugin initialization): Added advices for
|
||||||
|
retrieving the version of GCC at plugin compilation and loading
|
||||||
|
times.
|
||||||
|
|
||||||
2009-11-19 Basile Starynkevitch <basile@starynkevitch.net>
|
2009-11-19 Basile Starynkevitch <basile@starynkevitch.net>
|
||||||
|
|
||||||
* plugin.c (FMT_FOR_PLUGIN_EVENT): added definition.
|
* plugin.c (FMT_FOR_PLUGIN_EVENT): added definition.
|
||||||
|
|
|
@ -105,6 +105,25 @@ The function @code{plugin_default_version_check} takes two pointers to
|
||||||
such structure and compare them field by field. It can be used by the
|
such structure and compare them field by field. It can be used by the
|
||||||
plugin's @code{plugin_init} function.
|
plugin's @code{plugin_init} function.
|
||||||
|
|
||||||
|
The version of GCC used to compile the plugin can be found in the symbol
|
||||||
|
@code{gcc_version} defined in the header @file{plugin-version.h}. The
|
||||||
|
recommended version check to perform looks like
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
#include "plugin-version.h"
|
||||||
|
...
|
||||||
|
|
||||||
|
int
|
||||||
|
plugin_init (struct plugin_name_args *plugin_info,
|
||||||
|
struct plugin_gcc_version *version)
|
||||||
|
@{
|
||||||
|
if (!plugin_default_version_check (version, &gcc_version))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
@}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
but you can also check the individual fields if you want a less strict check.
|
||||||
|
|
||||||
@subsection Plugin callbacks
|
@subsection Plugin callbacks
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
2009-11-19 Rafael Avila de Espindola <espindola@google.com>
|
||||||
|
|
||||||
|
* g++.dg/plugin/selfassign.c: Include plugin-version.h.
|
||||||
|
(plugin_init): Pass correct version to plugin_default_version_check.
|
||||||
|
* gcc.dg/plugin/ggcplug.c: Include plugin-version.h.
|
||||||
|
(plugin_init): Pass correct version to plugin_default_version_check.
|
||||||
|
* gcc.dg/plugin/selfassign.c: Include plugin-version.h.
|
||||||
|
(plugin_init): Pass correct version to plugin_default_version_check.
|
||||||
|
|
||||||
2009-11-19 Jason Merrill <jason@redhat.com>
|
2009-11-19 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
PR c++/561
|
PR c++/561
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
#include "tree-pass.h"
|
#include "tree-pass.h"
|
||||||
#include "intl.h"
|
#include "intl.h"
|
||||||
|
#include "plugin-version.h"
|
||||||
|
|
||||||
int plugin_is_GPL_compatible;
|
int plugin_is_GPL_compatible;
|
||||||
|
|
||||||
|
@ -305,7 +306,7 @@ plugin_init (struct plugin_name_args *plugin_info,
|
||||||
bool enabled = true;
|
bool enabled = true;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!plugin_default_version_check (version, version))
|
if (!plugin_default_version_check (version, &gcc_version))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Self-assign detection should happen after SSA is constructed. */
|
/* Self-assign detection should happen after SSA is constructed. */
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "tree-pass.h"
|
#include "tree-pass.h"
|
||||||
#include "intl.h"
|
#include "intl.h"
|
||||||
#include "gcc-plugin.h"
|
#include "gcc-plugin.h"
|
||||||
|
#include "plugin-version.h"
|
||||||
|
|
||||||
int plugin_is_GPL_compatible;
|
int plugin_is_GPL_compatible;
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ plugin_init (struct plugin_name_args *plugin_info,
|
||||||
int argc = plugin_info->argc;
|
int argc = plugin_info->argc;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
struct plugin_argument *argv = plugin_info->argv;
|
struct plugin_argument *argv = plugin_info->argv;
|
||||||
if (!plugin_default_version_check (version, version))
|
if (!plugin_default_version_check (version, &gcc_version))
|
||||||
return 1;
|
return 1;
|
||||||
/* Process the plugin arguments. This plugin takes the following arguments:
|
/* Process the plugin arguments. This plugin takes the following arguments:
|
||||||
count-ggc-start count-ggc-end count-ggc-mark */
|
count-ggc-start count-ggc-end count-ggc-mark */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
#include "tree-pass.h"
|
#include "tree-pass.h"
|
||||||
#include "intl.h"
|
#include "intl.h"
|
||||||
|
#include "plugin-version.h"
|
||||||
|
|
||||||
int plugin_is_GPL_compatible;
|
int plugin_is_GPL_compatible;
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ plugin_init (struct plugin_name_args *plugin_info,
|
||||||
bool enabled = true;
|
bool enabled = true;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!plugin_default_version_check (version, version))
|
if (!plugin_default_version_check (version, &gcc_version))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Self-assign detection should happen after SSA is constructed. */
|
/* Self-assign detection should happen after SSA is constructed. */
|
||||||
|
|
Loading…
Reference in New Issue