aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r--gcc/tree-ssa-phiopt.c111
1 files changed, 73 insertions, 38 deletions
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 5e99678..ddcd040 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -2015,52 +2015,87 @@ gate_phiopt (void)
return 1;
}
-struct gimple_opt_pass pass_phiopt =
+namespace {
+
+const pass_data pass_data_phiopt =
{
- {
- GIMPLE_PASS,
- "phiopt", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_phiopt, /* gate */
- tree_ssa_phiopt, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_PHIOPT, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_verify_flow
- | TODO_verify_stmts /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "phiopt", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_PHIOPT, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_verify_flow
+ | TODO_verify_stmts ), /* todo_flags_finish */
};
+class pass_phiopt : public gimple_opt_pass
+{
+public:
+ pass_phiopt(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_phiopt, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_phiopt (ctxt_); }
+ bool gate () { return gate_phiopt (); }
+ unsigned int execute () { return tree_ssa_phiopt (); }
+
+}; // class pass_phiopt
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_phiopt (gcc::context *ctxt)
+{
+ return new pass_phiopt (ctxt);
+}
+
static bool
gate_cselim (void)
{
return flag_tree_cselim;
}
-struct gimple_opt_pass pass_cselim =
+namespace {
+
+const pass_data pass_data_cselim =
{
- {
- GIMPLE_PASS,
- "cselim", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_cselim, /* gate */
- tree_ssa_cs_elim, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_PHIOPT, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa
- | TODO_verify_flow
- | TODO_verify_stmts /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "cselim", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_TREE_PHIOPT, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_verify_flow
+ | TODO_verify_stmts ), /* todo_flags_finish */
};
+
+class pass_cselim : public gimple_opt_pass
+{
+public:
+ pass_cselim(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_cselim, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_cselim (); }
+ unsigned int execute () { return tree_ssa_cs_elim (); }
+
+}; // class pass_cselim
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_cselim (gcc::context *ctxt)
+{
+ return new pass_cselim (ctxt);
+}