aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index bd83f6a..8b4c0cc 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -234,14 +234,11 @@ cgraph_remove_node (struct cgraph_node *node)
/* Do not free the structure itself so the walk over chain can continue. */
}
-/* Notify finalize_compilation_unit that given node is reachable
- or needed. */
+/* Notify finalize_compilation_unit that given node is reachable. */
+
void
-cgraph_mark_needed_node (struct cgraph_node *node, int needed)
+cgraph_mark_reachable_node (struct cgraph_node *node)
{
- if (needed)
- node->needed = 1;
-
if (!node->reachable && DECL_SAVED_TREE (node->decl))
{
node->reachable = 1;
@@ -257,11 +254,20 @@ cgraph_mark_needed_node (struct cgraph_node *node, int needed)
for (node2 = node->nested; node2; node2 = node2->next_nested)
if (!node2->reachable)
- cgraph_mark_needed_node (node2, 0);
+ cgraph_mark_reachable_node (node2);
}
}
}
+/* Likewise indicate that a node is needed, i.e. reachable via some
+ external means. */
+
+void
+cgraph_mark_needed_node (struct cgraph_node *node)
+{
+ node->needed = 1;
+ cgraph_mark_reachable_node (node);
+}
/* Record call from CALLER to CALLEE */