aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfg.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-10-27 08:56:03 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-10-27 08:56:03 +0000
commit61183076f1dfbea5ac4fb6799aab9bc6e9aa8de5 (patch)
treebd4ad7e7b2c8112a0f115b874c66bb4632a2280b /gcc/cfg.c
parent88bae6f494dc867edd8e6257658974d629bdc53b (diff)
downloadgcc-61183076f1dfbea5ac4fb6799aab9bc6e9aa8de5.zip
gcc-61183076f1dfbea5ac4fb6799aab9bc6e9aa8de5.tar.gz
gcc-61183076f1dfbea5ac4fb6799aab9bc6e9aa8de5.tar.bz2
cfg.c (free_edge): Add function argument and use it instead of cfun.
2015-10-27 Richard Biener <rguenther@suse.de> * cfg.c (free_edge): Add function argument and use it instead of cfun. (clear_edges): Likewise. * cfg.h (clear_edges): Adjust prototype. * cfgexpand.c (pass_expand::execute): Adjust. * cfgloop.c (release_recorded_exits): Add function argument and use it instead of cfun. * cfgloop.h (release_recorded_exits): Adjust prototype. (loops_state_satisfies_p): Add overload with function argument. (loops_state_set): Likewise. (loops_state_clear): Likewise. (struct loop_iterator): Add function argument to constructor and iterator and use it instead of cfun. (FOR_EACH_LOOP_FN): New macro. (loop_optimizer_finalize): Add overload with function argument. * loop-init.c (loop_optimizer_init): Adjust. (fix_loop_structure): Likewise. (loop_optimizer_finaliz): Add function argument and use it instead of cfun. * tree-cfg.c (delete_tree_cfg_annotations): Likewise. * tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype. * cgraph.c (release_function_body): Do not push/pop cfun. * final.c (rest_of_clean_state): Adjust. * graphite.c (graphite_finalize): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa-dce.c (perform_tree_ssa_dce): Likewise. * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise. (tree_unroll_loops_completely): Likewise. (pass_complete_unrolli::execute): Likewise. * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates): Add function argument and use it instead of cfun. * tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates): Adjust prototype. * tree-ssa-loop.c (tree_ssa_loop_done): Adjust. * tree-ssa.c (delete_tree_ssa): Add function argument and use it instead of cfun. * tree-ssa.h (delete_tree_ssa): Adjust prototype. * tree-ssanames.c (fini_ssanames): Add function argument and use it instead of cfun. * tree-ssanames.c (fini_ssanames): Adjust prototype. * tree-vrp.c (execute_vrp): Adjust. * value-prof.c (free_histograms): Add function argument and use it instead of cfun. * value-prof.h (free_histograms): Adjust prototype. From-SVN: r229405
Diffstat (limited to 'gcc/cfg.c')
-rw-r--r--gcc/cfg.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 2bc7857..4c4531a 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -88,35 +88,35 @@ init_flow (struct function *the_fun)
without actually removing it from the pred/succ arrays. */
static void
-free_edge (edge e)
+free_edge (function *fn, edge e)
{
- n_edges_for_fn (cfun)--;
+ n_edges_for_fn (fn)--;
ggc_free (e);
}
/* Free the memory associated with the edge structures. */
void
-clear_edges (void)
+clear_edges (struct function *fn)
{
basic_block bb;
edge e;
edge_iterator ei;
- FOR_EACH_BB_FN (bb, cfun)
+ FOR_EACH_BB_FN (bb, fn)
{
FOR_EACH_EDGE (e, ei, bb->succs)
- free_edge (e);
+ free_edge (fn, e);
vec_safe_truncate (bb->succs, 0);
vec_safe_truncate (bb->preds, 0);
}
- FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR_FOR_FN (cfun)->succs)
- free_edge (e);
- vec_safe_truncate (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds, 0);
- vec_safe_truncate (ENTRY_BLOCK_PTR_FOR_FN (cfun)->succs, 0);
+ FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR_FOR_FN (fn)->succs)
+ free_edge (fn, e);
+ vec_safe_truncate (EXIT_BLOCK_PTR_FOR_FN (fn)->preds, 0);
+ vec_safe_truncate (ENTRY_BLOCK_PTR_FOR_FN (fn)->succs, 0);
- gcc_assert (!n_edges_for_fn (cfun));
+ gcc_assert (!n_edges_for_fn (fn));
}
/* Allocate memory for basic_block. */
@@ -350,7 +350,7 @@ remove_edge_raw (edge e)
disconnect_src (e);
disconnect_dest (e);
- free_edge (e);
+ free_edge (cfun, e);
}
/* Redirect an edge's successor from one block to another. */