summaryrefslogtreecommitdiff
path: root/gcc/stack-ptr-mod.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/stack-ptr-mod.c')
-rw-r--r--gcc/stack-ptr-mod.c51
1 files changed, 34 insertions, 17 deletions
diff --git a/gcc/stack-ptr-mod.c b/gcc/stack-ptr-mod.c
index 739bcfc3ac5..737a07f5727 100644
--- a/gcc/stack-ptr-mod.c
+++ b/gcc/stack-ptr-mod.c
@@ -90,22 +90,39 @@ rest_of_handle_stack_ptr_mod (void)
return 0;
}
-struct rtl_opt_pass pass_stack_ptr_mod =
+namespace {
+
+const pass_data pass_data_stack_ptr_mod =
{
- {
- RTL_PASS,
- "*stack_ptr_mod", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- NULL, /* gate */
- rest_of_handle_stack_ptr_mod, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ RTL_PASS, /* type */
+ "*stack_ptr_mod", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ false, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_stack_ptr_mod : public rtl_opt_pass
+{
+public:
+ pass_stack_ptr_mod(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_stack_ptr_mod, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ unsigned int execute () { return rest_of_handle_stack_ptr_mod (); }
+
+}; // class pass_stack_ptr_mod
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_stack_ptr_mod (gcc::context *ctxt)
+{
+ return new pass_stack_ptr_mod (ctxt);
+}