Commit 89480522 by Jan Hubicka Committed by Jan Hubicka

cgraph.c (cgraph_remove_node): Free DECL_INITIAL field of node.

	* cgraph.c (cgraph_remove_node): Free DECL_INITIAL field of node.
	* cgraphunit.c (verify_cgraph): Don't verify on syntax errors.
	(cgraph_expand_function): Remove stale cgraph edges of currently
	compiled function; fix non-unit-at-a-time code copying function
	node for later reuse.

From-SVN: r87181
parent 323e3709
2004-09-08 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_remove_node): Free DECL_INITIAL field of node.
* cgraphunit.c (verify_cgraph): Don't verify on syntax errors.
(cgraph_expand_function): Remove stale cgraph edges of currently
compiled function; fix non-unit-at-a-time code copying function
node for later reuse.
2004-09-08 Nathan Sidwell <nathan@codesourcery.com> 2004-09-08 Nathan Sidwell <nathan@codesourcery.com>
* vec.c (vec_p_reserve, vec_o_reserve): Rename to ... * vec.c (vec_p_reserve, vec_o_reserve): Rename to ...
......
...@@ -354,6 +354,7 @@ cgraph_remove_node (struct cgraph_node *node) ...@@ -354,6 +354,7 @@ cgraph_remove_node (struct cgraph_node *node)
{ {
DECL_SAVED_TREE (node->decl) = NULL; DECL_SAVED_TREE (node->decl) = NULL;
DECL_STRUCT_FUNCTION (node->decl) = NULL; DECL_STRUCT_FUNCTION (node->decl) = NULL;
DECL_INITIAL (node->decl) = error_mark_node;
} }
} }
cgraph_n_nodes--; cgraph_n_nodes--;
......
...@@ -610,6 +610,9 @@ verify_cgraph (void) ...@@ -610,6 +610,9 @@ verify_cgraph (void)
{ {
struct cgraph_node *node; struct cgraph_node *node;
if (sorrycount || errorcount)
return;
for (node = cgraph_nodes; node; node = node->next) for (node = cgraph_nodes; node; node = node->next)
verify_cgraph_node (node); verify_cgraph_node (node);
} }
...@@ -800,12 +803,15 @@ cgraph_expand_function (struct cgraph_node *node) ...@@ -800,12 +803,15 @@ cgraph_expand_function (struct cgraph_node *node)
gcc_assert (TREE_ASM_WRITTEN (node->decl)); gcc_assert (TREE_ASM_WRITTEN (node->decl));
current_function_decl = NULL; current_function_decl = NULL;
if (DECL_SAVED_TREE (node->decl) if (!cgraph_preserve_function_body_p (node->decl))
&& !cgraph_preserve_function_body_p (node->decl))
{ {
DECL_SAVED_TREE (node->decl) = NULL; DECL_SAVED_TREE (node->decl) = NULL;
DECL_STRUCT_FUNCTION (node->decl) = NULL; DECL_STRUCT_FUNCTION (node->decl) = NULL;
DECL_INITIAL (node->decl) = error_mark_node; DECL_INITIAL (node->decl) = error_mark_node;
/* Elliminate all call edges. This is important so the call_expr no longer
points to the dead function body. */
while (node->callees)
cgraph_remove_edge (node->callees);
} }
} }
......
...@@ -604,6 +604,11 @@ tree_rest_of_compilation (tree fndecl, bool nested_p) ...@@ -604,6 +604,11 @@ tree_rest_of_compilation (tree fndecl, bool nested_p)
} }
} }
/* We are not going to maintain the cgraph edges up to date.
Kill it so it won't confuse us. */
while (node->callees)
cgraph_remove_edge (node->callees);
if (!vars_to_rename) if (!vars_to_rename)
vars_to_rename = BITMAP_XMALLOC (); vars_to_rename = BITMAP_XMALLOC ();
...@@ -632,8 +637,12 @@ tree_rest_of_compilation (tree fndecl, bool nested_p) ...@@ -632,8 +637,12 @@ tree_rest_of_compilation (tree fndecl, bool nested_p)
cgraph_remove_edge (node->callees); cgraph_remove_edge (node->callees);
node->callees = saved_node->callees; node->callees = saved_node->callees;
saved_node->callees = NULL; saved_node->callees = NULL;
for (e = saved_node->callees; e; e = e->next_callee) for (e = node->callees; e; e = e->next_callee)
e->caller = node; {
if (e->callee->global.inlined_to)
e->callee->global.inlined_to = node;
e->caller = node;
}
cgraph_remove_node (saved_node); cgraph_remove_node (saved_node);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment