diff options
author | Trevor Saunders <tbsaunde@tbsaunde.org> | 2021-06-12 19:36:38 -0400 |
---|---|---|
committer | Trevor Saunders <tbsaunde@tbsaunde.org> | 2021-06-17 04:43:28 -0400 |
commit | 53c55d3204a69c4cce4cc5a982c42cec91178346 (patch) | |
tree | 7dd382841cab32c6800d475aa17e5f11fdf31bc4 /gcc/tree-ssa-phiprop.c | |
parent | 4541b5ec16178a1954066c54cd9220b7c8f74309 (diff) | |
download | gcc-53c55d3204a69c4cce4cc5a982c42cec91178346.zip gcc-53c55d3204a69c4cce4cc5a982c42cec91178346.tar.gz gcc-53c55d3204a69c4cce4cc5a982c42cec91178346.tar.bz2 |
return auto_vec from more dominance functions
This ensures the vector gets cleaned up by the caller when appropriate.
Signed-off-by: Trevor Saunders <tbsaunde@tbsaunde.org>
gcc/ChangeLog:
* dominance.c (get_dominated_to_depth): Return auto_vec<basic_block>.
* dominance.h (get_dominated_to_depth): Likewise.
(get_all_dominated_blocks): Likewise.
* cfgcleanup.c (delete_unreachable_blocks): Adjust.
* gcse.c (hoist_code): Likewise.
* tree-cfg.c (remove_edge_and_dominated_blocks): Likewise.
* tree-parloops.c (oacc_entry_exit_ok): Likewise.
* tree-ssa-dce.c (eliminate_unnecessary_stmts): Likewise.
* tree-ssa-phiprop.c (pass_phiprop::execute): Likewise.
Diffstat (limited to 'gcc/tree-ssa-phiprop.c')
-rw-r--r-- | gcc/tree-ssa-phiprop.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c index 64d6eda..78b0461 100644 --- a/gcc/tree-ssa-phiprop.c +++ b/gcc/tree-ssa-phiprop.c @@ -484,7 +484,6 @@ public: unsigned int pass_phiprop::execute (function *fun) { - vec<basic_block> bbs; struct phiprop_d *phivn; bool did_something = false; basic_block bb; @@ -499,8 +498,9 @@ pass_phiprop::execute (function *fun) phivn = XCNEWVEC (struct phiprop_d, n); /* Walk the dominator tree in preorder. */ - bbs = get_all_dominated_blocks (CDI_DOMINATORS, - single_succ (ENTRY_BLOCK_PTR_FOR_FN (fun))); + auto_vec<basic_block> bbs + = get_all_dominated_blocks (CDI_DOMINATORS, + single_succ (ENTRY_BLOCK_PTR_FOR_FN (fun))); FOR_EACH_VEC_ELT (bbs, i, bb) { /* Since we're going to move dereferences across predecessor @@ -514,7 +514,6 @@ pass_phiprop::execute (function *fun) if (did_something) gsi_commit_edge_inserts (); - bbs.release (); free (phivn); free_dominance_info (CDI_POST_DOMINATORS); |