one_time_plugin.c: (one_pass_gate): Convert to member function...

gcc/testsuite

2013-08-13  David Malcolm  <dmalcolm@redhat.com>

	* gcc.dg/plugin/one_time_plugin.c: (one_pass_gate): Convert
	to member function...
	(one_pass::gate): ...this.
	(one_pass_exec): Convert to member function...
	(one_pass::impl_execute): ...this.

From-SVN: r201680
This commit is contained in:
David Malcolm 2013-08-13 00:41:39 +00:00 committed by David Malcolm
parent f971dc24bf
commit b338b23f88
2 changed files with 26 additions and 18 deletions

View File

@ -1,3 +1,11 @@
2013-08-13 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/plugin/one_time_plugin.c: (one_pass_gate): Convert
to member function...
(one_pass::gate): ...this.
(one_pass_exec): Convert to member function...
(one_pass::impl_execute): ...this.
2013-08-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57416

View File

@ -12,22 +12,6 @@
int plugin_is_GPL_compatible;
static bool one_pass_gate (void)
{
return true;
}
static unsigned int one_pass_exec (void)
{
static int counter = 0;
if (counter > 0) {
printf ("Executed more than once \n");
}
counter++;
return 0;
}
namespace {
const pass_data pass_data_one_pass =
@ -53,13 +37,29 @@ public:
{}
/* opt_pass methods: */
bool gate () { return one_pass_gate (); }
unsigned int execute () { return one_pass_exec (); }
bool gate ();
unsigned int execute ();
}; // class one_pass
} // anon namespace
bool one_pass::gate (void)
{
return true;
}
unsigned int one_pass::execute ()
{
static int counter = 0;
if (counter > 0) {
printf ("Executed more than once \n");
}
counter++;
return 0;
}
gimple_opt_pass *
make_one_pass (gcc::context *ctxt)
{