Infer it from block.
/* The in array for the new back end return is now ready. */
dbg_info *const dbgi = get_irn_dbg_info(irn);
- ir_node *const ret = be_new_Return(dbgi, irg, bl, n_res, call->pop, n, in);
+ ir_node *const ret = be_new_Return(dbgi, bl, n_res, call->pop, n, in);
/* Set the register classes of the return's parameter accordingly. */
for (i = 0; i < n; ++i) {
int n_res = 1; /* TODO */
unsigned pop = 0; /* TODO */
size_t i;
- ir_node *ret;
assert(ARR_LEN(env->epilog.value_map) == n_return_in);
- ret = be_new_Return(dbgi, get_irn_irg(block), block, n_res, pop,
- n_return_in, in);
+ ir_node *const ret = be_new_Return(dbgi, block, n_res, pop, n_return_in, in);
for (i = 0; i < n_return_in; ++i) {
const reg_flag_t *regflag = &env->epilog.regs[i];
const arch_register_t *reg = regflag->reg;
return a->pop;
}
-ir_node *be_new_Return(dbg_info *dbg, ir_graph *irg, ir_node *block, int n_res,
- unsigned pop, int n, ir_node *in[])
+ir_node *be_new_Return(dbg_info *const dbg, ir_node *const block, int const n_res, unsigned const pop, int const n, ir_node **const in)
{
- be_return_attr_t *a;
- ir_node *res;
-
- res = new_ir_node(dbg, irg, block, op_be_Return, mode_X, n, in);
+ ir_graph *const irg = get_Block_irg(block);
+ ir_node *const res = new_ir_node(dbg, irg, block, op_be_Return, mode_X, n, in);
init_node_attr(res, n, 1);
be_set_constr_out(res, 0, arch_no_register_req);
- a = (be_return_attr_t*)get_irn_generic_attr(res);
+ be_return_attr_t *const a = (be_return_attr_t*)get_irn_generic_attr(res);
a->num_ret_vals = n_res;
a->pop = pop;
a->emit_pop = 0;
* Construct a new be_Return.
*
* @param dbg debug info
- * @param irg the graph where the new node will be placed
* @param block the block where the new node will be placed
* @param n_res number of "real" results
* @param pop pop number of bytes on return
* @param n number of inputs
* @param in input array
*/
-ir_node *be_new_Return(dbg_info *dbg, ir_graph *irg, ir_node *block, int n_res,
- unsigned pop, int n, ir_node *in[]);
+ir_node *be_new_Return(dbg_info *dbg, ir_node *block, int n_res, unsigned pop, int n, ir_node *in[]);
/** Returns the number of real returns values */
int be_Return_get_n_rets(const ir_node *ret);
int arity;
unsigned pop;
ir_node **in;
- ir_node *new_node;
assert(ret_val != NULL);
if (be_Return_get_n_rets(node) < 1 || ! ia32_cg_config.use_sse2) {
in[i] = be_transform_node(op);
}
}
- new_node = be_new_Return(dbgi, irg, block, arity, pop, arity, in);
+ ir_node *const new_node = be_new_Return(dbgi, block, arity, pop, arity, in);
copy_node_attr(irg, node, new_node);
return new_node;