summaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-24 13:27:41 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-24 13:27:41 +0000
commite60987771b70989d993174e876355b682227d54a (patch)
tree40e8e9f552d7ef293b2d19e281320018f0d15141 /gcc/ipa-prop.c
parentc071730666c14c9c6bf1bcd2adb0e3d44cdea43a (diff)
downloadgcc-e60987771b70989d993174e876355b682227d54a.tar.gz
2009-07-24 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (struct ipa_node_params): New flag node_enqued. (ipa_push_func_to_list_1): Declare. (ipa_push_func_to_list): New function. * ipa-prop.c (ipa_push_func_to_list_1): New function. (ipa_init_func_list): Call ipa_push_func_to_list_1. (ipa_push_func_to_list): Removed. (ipa_pop_func_from_list): Clear node_enqueued flag. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150053 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index a376f45c7b3..1a7003295a2 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -45,6 +45,24 @@ static struct cgraph_node_hook_list *node_removal_hook_holder;
static struct cgraph_2edge_hook_list *edge_duplication_hook_holder;
static struct cgraph_2node_hook_list *node_duplication_hook_holder;
+/* Add cgraph NODE described by INFO to the worklist WL regardless of whether
+ it is in one or not. It should almost never be used directly, as opposed to
+ ipa_push_func_to_list. */
+
+void
+ipa_push_func_to_list_1 (struct ipa_func_list **wl,
+ struct cgraph_node *node,
+ struct ipa_node_params *info)
+{
+ struct ipa_func_list *temp;
+
+ info->node_enqueued = 1;
+ temp = XCNEW (struct ipa_func_list);
+ temp->node = node;
+ temp->next = *wl;
+ *wl = temp;
+}
+
/* Initialize worklist to contain all functions. */
struct ipa_func_list *
@@ -57,43 +75,33 @@ ipa_init_func_list (void)
for (node = cgraph_nodes; node; node = node->next)
if (node->analyzed)
{
+ struct ipa_node_params *info = IPA_NODE_REF (node);
/* Unreachable nodes should have been eliminated before ipcp and
inlining. */
gcc_assert (node->needed || node->reachable);
- ipa_push_func_to_list (&wl, node);
+ ipa_push_func_to_list_1 (&wl, node, info);
}
return wl;
}
-/* Add cgraph node MT to the worklist. Set worklist element WL
- to point to MT. */
-
-void
-ipa_push_func_to_list (struct ipa_func_list **wl, struct cgraph_node *mt)
-{
- struct ipa_func_list *temp;
-
- temp = XCNEW (struct ipa_func_list);
- temp->node = mt;
- temp->next = *wl;
- *wl = temp;
-}
-
-/* Remove a function from the worklist. WL points to the first
- element in the list, which is removed. */
+/* Remove a function from the worklist WL and return it. */
struct cgraph_node *
-ipa_pop_func_from_list (struct ipa_func_list ** wl)
+ipa_pop_func_from_list (struct ipa_func_list **wl)
{
+ struct ipa_node_params *info;
struct ipa_func_list *first;
- struct cgraph_node *return_func;
+ struct cgraph_node *node;
first = *wl;
*wl = (*wl)->next;
- return_func = first->node;
+ node = first->node;
free (first);
- return return_func;
+
+ info = IPA_NODE_REF (node);
+ info->node_enqueued = 0;
+ return node;
}
/* Return index of the formal whose tree is PTREE in function which corresponds