diff options
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; |