diff options
Diffstat (limited to 'gcc/tree-into-ssa.c')
-rw-r--r-- | gcc/tree-into-ssa.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c index 696bdfd..ec51faa 100644 --- a/gcc/tree-into-ssa.c +++ b/gcc/tree-into-ssa.c @@ -245,12 +245,13 @@ compute_global_livein (bitmap livein, bitmap def_blocks) while (tos != worklist) { edge e; + edge_iterator ei; /* Pull a block off the worklist. */ bb = *--tos; /* For each predecessor block. */ - for (e = bb->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, bb->preds) { basic_block pred = e->src; int pred_index = pred->index; @@ -320,8 +321,9 @@ ssa_mark_phi_uses (struct dom_walk_data *walk_data, basic_block bb) edge e; tree phi, use; unsigned uid; + edge_iterator ei; - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { if (e->dest == EXIT_BLOCK_PTR) continue; @@ -730,6 +732,7 @@ ssa_rewrite_initialize_block (struct dom_walk_data *walk_data, basic_block bb) sbitmap names_to_rename = walk_data->global_data; edge e; bool abnormal_phi; + edge_iterator ei; if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "\n\nRenaming block #%d\n\n", bb->index); @@ -737,7 +740,7 @@ ssa_rewrite_initialize_block (struct dom_walk_data *walk_data, basic_block bb) /* Mark the unwind point for this block. */ VARRAY_PUSH_TREE (block_defs_stack, NULL_TREE); - for (e = bb->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, bb->preds) if (e->flags & EDGE_ABNORMAL) break; abnormal_phi = (e != NULL); @@ -774,8 +777,9 @@ rewrite_add_phi_arguments (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, basic_block bb) { edge e; + edge_iterator ei; - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { tree phi; @@ -803,8 +807,9 @@ ssa_rewrite_phi_arguments (struct dom_walk_data *walk_data, basic_block bb) edge e; sbitmap names_to_rename = walk_data->global_data; use_operand_p op; + edge_iterator ei; - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { tree phi; @@ -1033,7 +1038,8 @@ insert_phi_nodes_for (tree var, bitmap *dfs, varray_type *work_stack) /* If we are rewriting ssa names, add also the phi arguments. */ if (TREE_CODE (var) == SSA_NAME) { - for (e = bb->pred; e; e = e->pred_next) + edge_iterator ei; + FOR_EACH_EDGE (e, ei, bb->preds) add_phi_arg (&phi, var, e); } } @@ -1445,13 +1451,7 @@ rewrite_into_ssa (bool all) dfs = (bitmap *) xmalloc (last_basic_block * sizeof (bitmap *)); FOR_EACH_BB (bb) { - edge e; - int count = 0; - - for (e = bb->pred; e; e = e->pred_next) - count++; - - bb_ann (bb)->num_preds = count; + bb_ann (bb)->num_preds = EDGE_COUNT (bb->preds); dfs[bb->index] = BITMAP_XMALLOC (); } @@ -1580,13 +1580,7 @@ rewrite_ssa_into_ssa (void) dfs = (bitmap *) xmalloc (last_basic_block * sizeof (bitmap *)); FOR_EACH_BB (bb) { - edge e; - int count = 0; - - for (e = bb->pred; e; e = e->pred_next) - count++; - - bb_ann (bb)->num_preds = count; + bb_ann (bb)->num_preds = EDGE_COUNT (bb->preds); dfs[bb->index] = BITMAP_XMALLOC (); } |