From 3cda7b99b8d1bbddc0937e5529e4b3fdc0b2919d Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Tue, 4 Dec 2012 16:19:23 +0100 Subject: [PATCH] benode: Remove the parameter irg from be_new_Call(). Infer it from block. --- ir/be/beabi.c | 4 ++-- ir/be/benode.c | 6 +++--- ir/be/benode.h | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ir/be/beabi.c b/ir/be/beabi.c index 365989e1e..99868f26e 100644 --- a/ir/be/beabi.c +++ b/ir/be/beabi.c @@ -541,14 +541,14 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp) throws_exception = ir_throws_exception(irn); if (env->call->flags.call_has_imm && is_SymConst(call_ptr)) { /* direct call */ - low_call = be_new_Call(dbgi, irg, bl, curr_mem, sp->single_req, curr_sp, + low_call = be_new_Call(dbgi, bl, curr_mem, sp->single_req, curr_sp, sp->single_req, curr_sp, n_reg_results + pn_be_Call_first_res + ARR_LEN(destroyed_regs), n_ins, in, get_Call_type(irn)); be_Call_set_entity(low_call, get_SymConst_entity(call_ptr)); } else { /* indirect call */ - low_call = be_new_Call(dbgi, irg, bl, curr_mem, sp->single_req, curr_sp, + low_call = be_new_Call(dbgi, bl, curr_mem, sp->single_req, curr_sp, sp->reg_class->class_req, call_ptr, n_reg_results + pn_be_Call_first_res + ARR_LEN(destroyed_regs), n_ins, in, get_Call_type(irn)); diff --git a/ir/be/benode.c b/ir/be/benode.c index 53acdc57b..014156339 100644 --- a/ir/be/benode.c +++ b/ir/be/benode.c @@ -470,14 +470,13 @@ void be_Keep_add_node(ir_node *keep, const arch_register_class_t *cls, ir_node * add_register_req_in(keep, cls->class_req); } -ir_node *be_new_Call(dbg_info *dbg, ir_graph *irg, ir_node *bl, ir_node *mem, +ir_node *be_new_Call(dbg_info *dbg, ir_node *bl, ir_node *mem, const arch_register_req_t *sp_req, ir_node *sp, const arch_register_req_t *ptr_req, ir_node *ptr, int n_outs, int n, ir_node *in[], ir_type *call_tp) { be_call_attr_t *a; int real_n = n_be_Call_first_arg + n; - ir_node *irn; ir_node **real_in; NEW_ARR_A(ir_node *, real_in, real_n); @@ -486,7 +485,8 @@ ir_node *be_new_Call(dbg_info *dbg, ir_graph *irg, ir_node *bl, ir_node *mem, real_in[n_be_Call_ptr] = ptr; memcpy(&real_in[n_be_Call_first_arg], in, n * sizeof(in[0])); - irn = new_ir_node(dbg, irg, bl, op_be_Call, mode_T, real_n, real_in); + ir_graph *const irg = get_Block_irg(bl); + ir_node *const irn = new_ir_node(dbg, irg, bl, op_be_Call, mode_T, real_n, real_in); init_node_attr(irn, real_n, n_outs); a = (be_call_attr_t*)get_irn_generic_attr(irn); a->ent = NULL; diff --git a/ir/be/benode.h b/ir/be/benode.h index c8921ec0c..9bd6c721e 100644 --- a/ir/be/benode.h +++ b/ir/be/benode.h @@ -294,7 +294,6 @@ typedef enum { * Construct a new be_Call. * * @param dbg debug info - * @param irg the graph where the call is placed * @param block the block where the call is placed * @param mem the memory input of the call * @param sp the stack pointer input of the call @@ -305,7 +304,7 @@ typedef enum { * @param in the (register) inputs of this call * @param call_tp the call type of this call */ -ir_node *be_new_Call(dbg_info *dbg, ir_graph *irg, ir_node *block, ir_node *mem, +ir_node *be_new_Call(dbg_info *dbg, ir_node *block, ir_node *mem, const arch_register_req_t *sp_req, ir_node *sp, const arch_register_req_t *ptr_req, ir_node *ptr, int n_outs, int n, ir_node *in[], ir_type *call_tp); -- 2.20.1