On 04/20/2016 08:22 AM, [email protected] wrote:
-static rtx_expr_list *
+static vec<rtx>
extract_mentioned_regs (rtx x)
{
- rtx_expr_list *mentioned_regs = NULL;
+ vec<rtx> mentioned_regs = vNULL;
subrtx_var_iterator::array_type array;
FOR_EACH_SUBRTX_VAR (iter, array, x, NONCONST)
{
rtx x = *iter;
if (REG_P (x))
- mentioned_regs = alloc_EXPR_LIST (0, x, mentioned_regs);
+ mentioned_regs.safe_push (x);
}
return mentioned_regs;
}
Is it really such a great idea to return a vec by value? I'd rather pass
a pointer to it into the function and operate on that.
Bernd