summaryrefslogtreecommitdiff
path: root/gcc/lists.c
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-27 19:53:39 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-27 19:53:39 +0000
commit54267fdfa2487c67f4773fc664b0919b07fa221a (patch)
tree6b70cdb662152458e90a78b8cb9af235f424d8a0 /gcc/lists.c
parent13be9dc6f5f79a971db138df17efa7afc92b4121 (diff)
downloadgcc-54267fdfa2487c67f4773fc664b0919b07fa221a.tar.gz
Use rtx_insn_list in various places
gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214590 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lists.c')
-rw-r--r--gcc/lists.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/gcc/lists.c b/gcc/lists.c
index ce545cb56f3..5e07880a10b 100644
--- a/gcc/lists.c
+++ b/gcc/lists.c
@@ -101,15 +101,15 @@ remove_list_elem (rtx elem, rtx *listp)
/* This call is used in place of a gen_rtx_INSN_LIST. If there is a cached
node available, we'll use it, otherwise a call to gen_rtx_INSN_LIST
is made. */
-rtx
+rtx_insn_list *
alloc_INSN_LIST (rtx val, rtx next)
{
- rtx r;
+ rtx_insn_list *r;
if (unused_insn_list)
{
- r = unused_insn_list;
- unused_insn_list = XEXP (r, 1);
+ r = as_a <rtx_insn_list *> (unused_insn_list);
+ unused_insn_list = r->next ();
XEXP (r, 0) = val;
XEXP (r, 1) = next;
PUT_REG_NOTE_KIND (r, VOIDmode);
@@ -155,39 +155,39 @@ free_EXPR_LIST_list (rtx *listp)
/* This function will free up an entire list of INSN_LIST nodes. */
void
-free_INSN_LIST_list (rtx *listp)
+free_INSN_LIST_list (rtx_insn_list **listp)
{
if (*listp == 0)
return;
- free_list (listp, &unused_insn_list);
+ free_list ((rtx *)listp, &unused_insn_list);
}
/* Make a copy of the INSN_LIST list LINK and return it. */
-rtx
-copy_INSN_LIST (rtx link)
+rtx_insn_list *
+copy_INSN_LIST (rtx_insn_list *link)
{
- rtx new_queue;
- rtx *pqueue = &new_queue;
+ rtx_insn_list *new_queue;
+ rtx_insn_list **pqueue = &new_queue;
- for (; link; link = XEXP (link, 1))
+ for (; link; link = link->next ())
{
- rtx x = XEXP (link, 0);
- rtx newlink = alloc_INSN_LIST (x, NULL);
+ rtx_insn *x = link->insn ();
+ rtx_insn_list *newlink = alloc_INSN_LIST (x, NULL);
*pqueue = newlink;
- pqueue = &XEXP (newlink, 1);
+ pqueue = (rtx_insn_list **)&XEXP (newlink, 1);
}
- *pqueue = NULL_RTX;
+ *pqueue = NULL;
return new_queue;
}
/* Duplicate the INSN_LIST elements of COPY and prepend them to OLD. */
-rtx
-concat_INSN_LIST (rtx copy, rtx old)
+rtx_insn_list *
+concat_INSN_LIST (rtx_insn_list *copy, rtx_insn_list *old)
{
- rtx new_rtx = old;
- for (; copy ; copy = XEXP (copy, 1))
+ rtx_insn_list *new_rtx = old;
+ for (; copy ; copy = copy->next ())
{
- new_rtx = alloc_INSN_LIST (XEXP (copy, 0), new_rtx);
+ new_rtx = alloc_INSN_LIST (copy->insn (), new_rtx);
PUT_REG_NOTE_KIND (new_rtx, REG_NOTE_KIND (copy));
}
return new_rtx;
@@ -213,19 +213,19 @@ free_INSN_LIST_node (rtx ptr)
/* Remove and free corresponding to ELEM node in the INSN_LIST pointed to
by LISTP. */
void
-remove_free_INSN_LIST_elem (rtx elem, rtx *listp)
+remove_free_INSN_LIST_elem (rtx_insn *elem, rtx_insn_list **listp)
{
- free_INSN_LIST_node (remove_list_elem (elem, listp));
+ free_INSN_LIST_node (remove_list_elem (elem, (rtx *)listp));
}
/* Remove and free the first node in the INSN_LIST pointed to by LISTP. */
-rtx
-remove_free_INSN_LIST_node (rtx *listp)
+rtx_insn *
+remove_free_INSN_LIST_node (rtx_insn_list **listp)
{
- rtx node = *listp;
- rtx elem = XEXP (node, 0);
+ rtx_insn_list *node = *listp;
+ rtx_insn *elem = node->insn ();
- remove_list_node (listp);
+ remove_list_node ((rtx *)listp);
free_INSN_LIST_node (node);
return elem;