diff options
author | David Malcolm <dmalcolm@redhat.com> | 2013-08-13 00:41:39 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2013-08-13 00:41:39 +0000 |
commit | b338b23f8875f26f1c4f598faac6c36874ae48f2 (patch) | |
tree | f2a705b7a51f978d87ed3c6714cfe696d7ca2992 /gcc | |
parent | f971dc24bfe351b1f90cf07fbea8db66a7460bb2 (diff) | |
download | gcc-b338b23f8875f26f1c4f598faac6c36874ae48f2.zip gcc-b338b23f8875f26f1c4f598faac6c36874ae48f2.tar.gz gcc-b338b23f8875f26f1c4f598faac6c36874ae48f2.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/plugin/one_time_plugin.c | 36 |
2 files changed, 26 insertions, 18 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e6a2d8b..6b82931 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c index 2d996da..7e93e65 100644 --- a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c +++ b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c @@ -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) { |