diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-29 11:37:55 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-29 11:37:55 +0000 |
commit | 21a003a7bcc461722bcc787d46ebe1ccf973dcde (patch) | |
tree | 223dccd8832873ad291ed8fecbf1eae8a75f55c0 /gcc/dominance.c | |
parent | 54751bcf5d01eec45ff1ff280d5f0ca527aa58f6 (diff) | |
download | gcc-21a003a7bcc461722bcc787d46ebe1ccf973dcde.tar.gz |
2014-04-29 Richard Biener <rguenther@suse.de>
* dominance.c (free_dominance_info): Add overload with
function parameter.
(dom_info_state): Likewise.
(dom_info_available_p): Likewise.
* basic-block.h (free_dominance_info, dom_info_state,
dom_info_available_p): Declare overloads.
* passes.c (execute_function_todo): Verify that verifiers
don't change dominator info state. Drop dominator info
for IPA pass invocations.
* cgraph.c (release_function_body): Restore asserts that
dominator information is released.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209892 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dominance.c')
-rw-r--r-- | gcc/dominance.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/gcc/dominance.c b/gcc/dominance.c index ff0dfe6714f..7adec4f7376 100644 --- a/gcc/dominance.c +++ b/gcc/dominance.c @@ -681,24 +681,30 @@ calculate_dominance_info (enum cdi_direction dir) /* Free dominance information for direction DIR. */ void -free_dominance_info (enum cdi_direction dir) +free_dominance_info (function *fn, enum cdi_direction dir) { basic_block bb; unsigned int dir_index = dom_convert_dir_to_idx (dir); - if (!dom_info_available_p (dir)) + if (!dom_info_available_p (fn, dir)) return; - FOR_ALL_BB_FN (bb, cfun) + FOR_ALL_BB_FN (bb, fn) { et_free_tree_force (bb->dom[dir_index]); bb->dom[dir_index] = NULL; } et_free_pools (); - n_bbs_in_dom_tree[dir_index] = 0; + fn->cfg->x_n_bbs_in_dom_tree[dir_index] = 0; + + fn->cfg->x_dom_computed[dir_index] = DOM_NONE; +} - dom_computed[dir_index] = DOM_NONE; +void +free_dominance_info (enum cdi_direction dir) +{ + free_dominance_info (cfun, dir); } /* Return the immediate dominator of basic block BB. */ @@ -1461,11 +1467,19 @@ next_dom_son (enum cdi_direction dir, basic_block bb) /* Return dominance availability for dominance info DIR. */ enum dom_state -dom_info_state (enum cdi_direction dir) +dom_info_state (function *fn, enum cdi_direction dir) { + if (!fn->cfg) + return DOM_NONE; + unsigned int dir_index = dom_convert_dir_to_idx (dir); + return fn->cfg->x_dom_computed[dir_index]; +} - return dom_computed[dir_index]; +enum dom_state +dom_info_state (enum cdi_direction dir) +{ + return dom_info_state (cfun, dir); } /* Set the dominance availability for dominance info DIR to NEW_STATE. */ @@ -1481,11 +1495,15 @@ set_dom_info_availability (enum cdi_direction dir, enum dom_state new_state) /* Returns true if dominance information for direction DIR is available. */ bool -dom_info_available_p (enum cdi_direction dir) +dom_info_available_p (function *fn, enum cdi_direction dir) { - unsigned int dir_index = dom_convert_dir_to_idx (dir); + return dom_info_state (fn, dir) != DOM_NONE; +} - return dom_computed[dir_index] != DOM_NONE; +bool +dom_info_available_p (enum cdi_direction dir) +{ + return dom_info_available_p (cfun, dir); } DEBUG_FUNCTION void |