summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiprop.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-phiprop.c')
-rw-r--r--gcc/tree-ssa-phiprop.c71
1 files changed, 32 insertions, 39 deletions
diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c
index 4d66c12a606..0154b47af74 100644
--- a/gcc/tree-ssa-phiprop.c
+++ b/gcc/tree-ssa-phiprop.c
@@ -374,8 +374,37 @@ next:;
/* Main entry for phiprop pass. */
-static unsigned int
-tree_ssa_phiprop (void)
+namespace {
+
+const pass_data pass_data_phiprop =
+{
+ GIMPLE_PASS, /* type */
+ "phiprop", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_execute */
+ TV_TREE_PHIPROP, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */
+};
+
+class pass_phiprop : public gimple_opt_pass
+{
+public:
+ pass_phiprop (gcc::context *ctxt)
+ : gimple_opt_pass (pass_data_phiprop, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ virtual bool gate (function *) { return flag_tree_phiprop; }
+ virtual unsigned int execute (function *);
+
+}; // class pass_phiprop
+
+unsigned int
+pass_phiprop::execute (function *fun)
{
vec<basic_block> bbs;
struct phiprop_d *phivn;
@@ -393,7 +422,7 @@ tree_ssa_phiprop (void)
/* Walk the dominator tree in preorder. */
bbs = get_all_dominated_blocks (CDI_DOMINATORS,
- single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun)));
+ single_succ (ENTRY_BLOCK_PTR_FOR_FN (fun)));
FOR_EACH_VEC_ELT (bbs, i, bb)
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
did_something |= propagate_with_phi (bb, gsi_stmt (gsi), phivn, n);
@@ -409,42 +438,6 @@ tree_ssa_phiprop (void)
return 0;
}
-static bool
-gate_phiprop (void)
-{
- return flag_tree_phiprop;
-}
-
-namespace {
-
-const pass_data pass_data_phiprop =
-{
- GIMPLE_PASS, /* type */
- "phiprop", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- true, /* has_gate */
- true, /* has_execute */
- TV_TREE_PHIPROP, /* tv_id */
- ( PROP_cfg | PROP_ssa ), /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */
-};
-
-class pass_phiprop : public gimple_opt_pass
-{
-public:
- pass_phiprop (gcc::context *ctxt)
- : gimple_opt_pass (pass_data_phiprop, ctxt)
- {}
-
- /* opt_pass methods: */
- bool gate () { return gate_phiprop (); }
- unsigned int execute () { return tree_ssa_phiprop (); }
-
-}; // class pass_phiprop
-
} // anon namespace
gimple_opt_pass *