summaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-04 11:30:10 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-04 11:30:10 +0000
commitb62f482da3af0ea47125e2d70c1670b3b9eaf411 (patch)
tree58cae202af2ebee37934e16f8848037db54c9be9 /gcc/cgraph.c
parente08087848d41ad8f4cbd6954cc6e867fcd15f7ec (diff)
downloadgcc-b62f482da3af0ea47125e2d70c1670b3b9eaf411.tar.gz
* cgraph.c (cgraph_release_function_body): New function.
(cgraph_remove_node): Use it. * cgraph.h (cgraph_release_function_body): Declare. * cgraphunit.c (cgraph_expand_function): Use it. * ipa.c (cgraph_remove_unreahchable_nodes): Use it. * tree-ssa.c (delete_tree_ssa): Allow to be called before aliasing is initialized and while compilation of other function is running. * tree-optimize.c (execute_free_cfg_annotations): Move code to clear statement CFG annotations from here to ... * tree-cfg.c (delete_tree_cfg_annotations): ... here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120437 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 1baed252439..8914569b395 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -468,6 +468,27 @@ cgraph_node_remove_callers (struct cgraph_node *node)
node->callers = NULL;
}
+/* Release memory used to represent body of function NODE. */
+
+void
+cgraph_release_function_body (struct cgraph_node *node)
+{
+ if (DECL_STRUCT_FUNCTION (node->decl)
+ && DECL_STRUCT_FUNCTION (node->decl)->gimple_df)
+ {
+ tree old_decl = current_function_decl;
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
+ current_function_decl = node->decl;
+ delete_tree_ssa ();
+ delete_tree_cfg_annotations ();
+ current_function_decl = old_decl;
+ pop_cfun();
+ }
+ DECL_SAVED_TREE (node->decl) = NULL;
+ DECL_STRUCT_FUNCTION (node->decl) = NULL;
+ DECL_INITIAL (node->decl) = error_mark_node;
+}
+
/* Remove the node from cgraph. */
void
@@ -541,11 +562,7 @@ cgraph_remove_node (struct cgraph_node *node)
}
if (kill_body && flag_unit_at_a_time)
- {
- DECL_SAVED_TREE (node->decl) = NULL;
- DECL_STRUCT_FUNCTION (node->decl) = NULL;
- DECL_INITIAL (node->decl) = error_mark_node;
- }
+ cgraph_release_function_body (node);
node->decl = NULL;
if (node->call_site_hash)
{