X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbenode.c;h=a0457f9a3341d4773ea355f76b1b015ded032e4a;hb=b7af5a581e3e7c779b74f5f6d3eabe83543f0c00;hp=dc215ac625f7da0eaf24d697000153ae93696bb3;hpb=93783832aaeef773668105ce893f61faf8b97cde;p=libfirm diff --git a/ir/be/benode.c b/ir/be/benode.c index dc215ac62..a0457f9a3 100644 --- a/ir/be/benode.c +++ b/ir/be/benode.c @@ -42,6 +42,8 @@ #include "offset.h" #include "bitfiddle.h" #include "raw_bitset.h" +#include "error.h" +#include "array_t.h" #include "irop_t.h" #include "irmode_t.h" @@ -468,7 +470,7 @@ ir_node *be_new_MemPerm(const arch_env_t *arch_env, ir_graph *irg, ir_node *bl, { int i; ir_node *frame = get_irg_frame(irg); - const arch_register_class_t *cls_frame = arch_get_irn_reg_class(arch_env, frame, -1); + const arch_register_class_t *cls_frame = arch_get_irn_reg_class(frame, -1); ir_node *irn; const arch_register_t *sp = arch_env->sp; be_memperm_attr_t *attr; @@ -760,29 +762,6 @@ ir_node *be_new_RegParams(ir_graph *irg, ir_node *bl, int n_outs) return res; } -ir_node *be_RegParams_append_out_reg(ir_node *regparams, - const arch_env_t *arch_env, - const arch_register_t *reg) -{ - ir_graph *irg = get_irn_irg(regparams); - ir_node *block = get_nodes_block(regparams); - be_node_attr_t *attr = get_irn_attr(regparams); - const arch_register_class_t *cls = arch_register_get_class(reg); - ir_mode *mode = arch_register_class_mode(cls); - int n = ARR_LEN(attr->reg_data); - ir_node *proj; - - assert(be_is_RegParams(regparams)); - proj = new_r_Proj(irg, block, regparams, mode, n); - add_register_req(regparams); - be_set_constr_single_reg(regparams, BE_OUT_POS(n), reg); - arch_set_irn_register(arch_env, proj, reg); - - /* TODO decide, whether we need to set ignore/modify sp flags here? */ - - return proj; -} - ir_node *be_new_FrameAddr(const arch_register_class_t *cls_frame, ir_graph *irg, ir_node *bl, ir_node *frame, ir_entity *ent) { be_frame_attr_t *a; @@ -1052,32 +1031,32 @@ int be_get_IncSP_align(const ir_node *irn) return a->align; } -ir_node *be_spill(const arch_env_t *arch_env, ir_node *block, ir_node *irn) +ir_node *be_spill(ir_node *block, ir_node *irn) { ir_graph *irg = get_irn_irg(block); ir_node *frame = get_irg_frame(irg); - const arch_register_class_t *cls = arch_get_irn_reg_class(arch_env, irn, -1); - const arch_register_class_t *cls_frame = arch_get_irn_reg_class(arch_env, frame, -1); + const arch_register_class_t *cls = arch_get_irn_reg_class(irn, -1); + const arch_register_class_t *cls_frame = arch_get_irn_reg_class(frame, -1); ir_node *spill; spill = be_new_Spill(cls, cls_frame, irg, block, frame, irn); return spill; } -ir_node *be_reload(const arch_env_t *arch_env, const arch_register_class_t *cls, ir_node *insert, ir_mode *mode, ir_node *spill) +ir_node *be_reload(const arch_register_class_t *cls, ir_node *insert, ir_mode *mode, ir_node *spill) { ir_node *reload; ir_node *bl = is_Block(insert) ? insert : get_nodes_block(insert); ir_graph *irg = get_irn_irg(bl); ir_node *frame = get_irg_frame(irg); - const arch_register_class_t *cls_frame = arch_get_irn_reg_class(arch_env, frame, -1); + const arch_register_class_t *cls_frame = arch_get_irn_reg_class(frame, -1); assert(be_is_Spill(spill) || (is_Phi(spill) && get_irn_mode(spill) == mode_M)); reload = be_new_Reload(cls, cls_frame, irg, bl, frame, spill, mode); if (is_Block(insert)) { - insert = sched_skip(insert, 0, sched_skip_cf_predicator, (void *) arch_env); + insert = sched_skip(insert, 0, sched_skip_cf_predicator, NULL); sched_add_after(insert, reload); } else { sched_add_before(insert, reload); @@ -1313,7 +1292,7 @@ const arch_register_req_t *get_Phi_reg_req_recursive(const ir_node *phi, /* Matze: don't we unnecessary constraint our phis with this? * we only need to take the regclass IMO*/ if(!is_Phi(op)) - return arch_get_register_req(phi_handler.arch_env, op, BE_OUT_POS(0)); + return arch_get_register_req(op, BE_OUT_POS(0)); } /* @@ -1363,11 +1342,9 @@ const arch_register_req_t *phi_get_irn_reg_req(const ir_node *irn, int pos) return &attr->req; } -void be_set_phi_reg_req(const arch_env_t *arch_env, ir_node *node, - const arch_register_req_t *req) +void be_set_phi_reg_req(ir_node *node, const arch_register_req_t *req) { phi_attr_t *attr; - (void) arch_env; assert(mode_is_datab(get_irn_mode(node))); @@ -1375,11 +1352,9 @@ void be_set_phi_reg_req(const arch_env_t *arch_env, ir_node *node, memcpy(&attr->req, req, sizeof(req[0])); } -void be_set_phi_flags(const arch_env_t *arch_env, ir_node *node, - arch_irn_flags_t flags) +void be_set_phi_flags(ir_node *node, arch_irn_flags_t flags) { phi_attr_t *attr; - (void) arch_env; assert(mode_is_datab(get_irn_mode(node))); @@ -1421,14 +1396,14 @@ static void phi_set_frame_entity(ir_node *irn, ir_entity *ent) { (void) irn; (void) ent; - assert(0); + panic("phi_set_frame_entity() should not be called"); } static void phi_set_frame_offset(ir_node *irn, int bias) { (void) irn; (void) bias; - assert(0); + panic("phi_set_frame_offset() should not be called"); } static int phi_get_sp_bias(const ir_node *irn)