* 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
+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 ...
{
DECL_SAVED_TREE (node->decl) = NULL;
DECL_STRUCT_FUNCTION (node->decl) = NULL;
+ DECL_INITIAL (node->decl) = error_mark_node;
}
}
cgraph_n_nodes--;
{
struct cgraph_node *node;
+ if (sorrycount || errorcount)
+ return;
+
for (node = cgraph_nodes; node; node = node->next)
verify_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);
}
}
}
}
+ /* 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 ();
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);
}
}