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
This commit is contained in:
Jan Hubicka 2004-09-08 11:28:06 +02:00 committed by Jan Hubicka
parent 323e3709b9
commit 8948052222
4 changed files with 28 additions and 4 deletions

View File

@ -1,3 +1,11 @@
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>
* vec.c (vec_p_reserve, vec_o_reserve): Rename to ...

View File

@ -354,6 +354,7 @@ cgraph_remove_node (struct cgraph_node *node)
{
DECL_SAVED_TREE (node->decl) = NULL;
DECL_STRUCT_FUNCTION (node->decl) = NULL;
DECL_INITIAL (node->decl) = error_mark_node;
}
}
cgraph_n_nodes--;

View File

@ -610,6 +610,9 @@ verify_cgraph (void)
{
struct cgraph_node *node;
if (sorrycount || errorcount)
return;
for (node = cgraph_nodes; node; node = node->next)
verify_cgraph_node (node);
}
@ -800,12 +803,15 @@ cgraph_expand_function (struct cgraph_node *node)
gcc_assert (TREE_ASM_WRITTEN (node->decl));
current_function_decl = NULL;
if (DECL_SAVED_TREE (node->decl)
&& !cgraph_preserve_function_body_p (node->decl))
if (!cgraph_preserve_function_body_p (node->decl))
{
DECL_SAVED_TREE (node->decl) = NULL;
DECL_STRUCT_FUNCTION (node->decl) = NULL;
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);
}
}

View File

@ -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)
vars_to_rename = BITMAP_XMALLOC ();
@ -632,8 +637,12 @@ tree_rest_of_compilation (tree fndecl, bool nested_p)
cgraph_remove_edge (node->callees);
node->callees = saved_node->callees;
saved_node->callees = NULL;
for (e = saved_node->callees; e; e = e->next_callee)
e->caller = node;
for (e = node->callees; e; e = e->next_callee)
{
if (e->callee->global.inlined_to)
e->callee->global.inlined_to = node;
e->caller = node;
}
cgraph_remove_node (saved_node);
}
}