diff options
author | Richard Biener <rguenther@suse.de> | 2015-10-27 08:56:03 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-10-27 08:56:03 +0000 |
commit | 61183076f1dfbea5ac4fb6799aab9bc6e9aa8de5 (patch) | |
tree | bd4ad7e7b2c8112a0f115b874c66bb4632a2280b /gcc/cgraph.c | |
parent | 88bae6f494dc867edd8e6257658974d629bdc53b (diff) | |
download | gcc-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/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 1a64d789..cfcfaf3 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1685,39 +1685,38 @@ cgraph_node::remove_callers (void) void release_function_body (tree decl) { - if (DECL_STRUCT_FUNCTION (decl)) + function *fn = DECL_STRUCT_FUNCTION (decl); + if (fn) { - if (DECL_STRUCT_FUNCTION (decl)->cfg - || DECL_STRUCT_FUNCTION (decl)->gimple_df) + if (fn->cfg + || fn->gimple_df) { - push_cfun (DECL_STRUCT_FUNCTION (decl)); - if (cfun->cfg - && current_loops) + if (fn->cfg + && loops_for_fn (fn)) { - cfun->curr_properties &= ~PROP_loops; - loop_optimizer_finalize (); + fn->curr_properties &= ~PROP_loops; + loop_optimizer_finalize (fn); } - if (cfun->gimple_df) + if (fn->gimple_df) { - delete_tree_ssa (); - delete_tree_cfg_annotations (); - cfun->eh = NULL; + delete_tree_ssa (fn); + delete_tree_cfg_annotations (fn); + fn->eh = NULL; } - if (cfun->cfg) + if (fn->cfg) { - gcc_assert (!dom_info_available_p (CDI_DOMINATORS)); - gcc_assert (!dom_info_available_p (CDI_POST_DOMINATORS)); - clear_edges (); - cfun->cfg = NULL; + gcc_assert (!dom_info_available_p (fn, CDI_DOMINATORS)); + gcc_assert (!dom_info_available_p (fn, CDI_POST_DOMINATORS)); + clear_edges (fn); + fn->cfg = NULL; } - if (cfun->value_histograms) - free_histograms (); - pop_cfun (); + if (fn->value_histograms) + free_histograms (fn); } gimple_set_body (decl, NULL); /* Struct function hangs a lot of data that would leak if we didn't removed all pointers to it. */ - ggc_free (DECL_STRUCT_FUNCTION (decl)); + ggc_free (fn); DECL_STRUCT_FUNCTION (decl) = NULL; } DECL_SAVED_TREE (decl) = NULL; |