Build a list of expanded rtxes in the EXPR_LIST pointed to by QUEUE. */
static void
-apply_iterators (rtx original, rtx *queue)
+apply_iterators (rtx original, vec<rtx> *queue)
{
unsigned int i;
const char *condition;
{
/* Raise an error if any attributes were used. */
apply_attribute_uses ();
- XEXP (*queue, 0) = original;
- XEXP (*queue, 1) = NULL_RTX;
+ queue->safe_push (original);
return;
}
}
}
/* Add the new rtx to the end of the queue. */
- XEXP (*queue, 0) = x;
- XEXP (*queue, 1) = NULL_RTX;
+ queue->safe_push (x);
/* Lexicographically increment the iterator value sequence.
That is, cycle through iterator values, starting from the right,
break;
iterator->current_value = iterator->values;
}
-
- /* At least one more rtx to go. Allocate room for it. */
- XEXP (*queue, 1) = rtx_alloc (EXPR_LIST);
- queue = &XEXP (*queue, 1);
}
}
define_subst ATTR_NAME should be applied. This attribute is set and
defined implicitly and automatically. */
static void
-add_define_attr_for_define_subst (const char *attr_name, rtx *queue)
+add_define_attr_for_define_subst (const char *attr_name, vec<rtx> *queue)
{
rtx const_str, return_rtx;
XSTR (return_rtx, 1) = xstrdup ("no,yes");
XEXP (return_rtx, 2) = const_str;
- XEXP (*queue, 0) = return_rtx;
- XEXP (*queue, 1) = NULL_RTX;
+ queue->safe_push (return_rtx);
}
/* This routine generates DEFINE_SUBST_ATTR expression with operands
ATTR_OPERANDS and places it to QUEUE. */
static void
-add_define_subst_attr (const char **attr_operands, rtx *queue)
+add_define_subst_attr (const char **attr_operands, vec<rtx> *queue)
{
rtx return_rtx;
int i;
for (i = 0; i < 4; i++)
XSTR (return_rtx, i) = xstrdup (attr_operands[i]);
- XEXP (*queue, 0) = return_rtx;
- XEXP (*queue, 1) = NULL_RTX;
+ queue->safe_push (return_rtx);
}
/* Read define_subst_attribute construction. It has next form:
static void
read_subst_mapping (htab_t subst_iters_table, htab_t subst_attrs_table,
- rtx *queue)
+ vec<rtx> *queue)
{
struct mapping *m;
struct map_value **end_ptr;
const char *attr_operands[4];
- rtx * queue_elem = queue;
int i;
for (i = 0; i < 4; i++)
attr_operands[i] = read_string (false);
- add_define_subst_attr (attr_operands, queue_elem);
+ add_define_subst_attr (attr_operands, queue);
bind_subst_iter_and_attr (attr_operands[1], attr_operands[0]);
end_ptr = add_map_value (end_ptr, 1, "");
end_ptr = add_map_value (end_ptr, 2, "");
- /* Add element to the queue. */
- XEXP (*queue, 1) = rtx_alloc (EXPR_LIST);
- queue_elem = &XEXP (*queue, 1);
-
- add_define_attr_for_define_subst (attr_operands[1], queue_elem);
+ add_define_attr_for_define_subst (attr_operands[1], queue);
}
m = add_mapping (&substs, subst_attrs_table, attr_operands[0]);
store the list of rtxes as an EXPR_LIST in *X. */
bool
-read_rtx (const char *rtx_name, rtx *x)
+read_rtx (const char *rtx_name, vec<rtx> *rtxen)
{
- static rtx queue_head;
+ static bool initialized = false;
/* Do one-time initialization. */
- if (queue_head == 0)
+ if (!initialized)
{
initialize_iterators ();
- queue_head = rtx_alloc (EXPR_LIST);
+ initialized = true;
}
/* Handle various rtx-related declarations that aren't themselves
}
if (strcmp (rtx_name, "define_subst_attr") == 0)
{
- read_subst_mapping (substs.iterators, substs.attrs, &queue_head);
- *x = queue_head;
+ read_subst_mapping (substs.iterators, substs.attrs, rtxen);
/* READ_SUBST_MAPPING could generate a new DEFINE_ATTR. Return
TRUE to process it. */
return true;
}
- apply_iterators (read_rtx_code (rtx_name), &queue_head);
+ apply_iterators (read_rtx_code (rtx_name), rtxen);
iterator_uses.truncate (0);
attribute_uses.truncate (0);
- *x = queue_head;
return true;
}