X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fopt_polymorphy.c;h=5a218e4607a42a14a6c8709157bb486a00586f74;hb=762b472fc81c73cf7a1b0041b8cd286b7206d79d;hp=fd5c9535398305697a9ce8a5a0d18a8fc7be961e;hpb=ea75e9d38674b468f602a0699fb64b9c01254797;p=libfirm diff --git a/ir/opt/opt_polymorphy.c b/ir/opt/opt_polymorphy.c index fd5c95353..5a218e460 100644 --- a/ir/opt/opt_polymorphy.c +++ b/ir/opt/opt_polymorphy.c @@ -81,7 +81,7 @@ static ir_type *get_dynamic_type(ir_node *ptr) /* skip Cast and Confirm nodes */ for (;;) { - ir_opcode code = get_irn_opcode(ptr); + unsigned code = get_irn_opcode(ptr); switch (code) { case iro_Cast: @@ -91,7 +91,7 @@ static ir_type *get_dynamic_type(ir_node *ptr) ptr = get_Confirm_value(ptr); continue; default: - ; + break; } break; } @@ -127,7 +127,7 @@ ir_node *transform_node_Sel(ir_node *node) if (get_irp_phase_state() == phase_building) return node; - if (!(get_opt_optimize() && get_opt_dyn_meth_dispatch())) + if (!get_opt_dyn_meth_dispatch()) return node; if (!is_Method_type(get_entity_type(ent))) @@ -142,10 +142,7 @@ ir_node *transform_node_Sel(ir_node *node) /* We could remove the Call depending on this Sel. */ new_node = node; } else { - ir_node *rem_block = get_cur_block(); - set_cur_block(get_nodes_block(node)); - new_node = copy_const_value(get_irn_dbg_info(node), get_atomic_ent_value(ent)); - set_cur_block(rem_block); + new_node = copy_const_value(get_irn_dbg_info(node), get_atomic_ent_value(ent), get_nodes_block(node)); DBG_OPT_POLY(node, new_node); } return new_node; @@ -157,15 +154,11 @@ ir_node *transform_node_Sel(ir_node *node) if (dyn_tp != firm_unknown_type) { ir_entity *called_ent; - ir_node *rem_block; /* We know which method will be called, no dispatch necessary. */ called_ent = resolve_ent_polymorphy(dyn_tp, ent); - rem_block = get_cur_block(); - set_cur_block(get_nodes_block(node)); - new_node = copy_const_value(get_irn_dbg_info(node), get_atomic_ent_value(called_ent)); - set_cur_block(rem_block); + new_node = copy_const_value(get_irn_dbg_info(node), get_atomic_ent_value(called_ent), get_nodes_block(node)); DBG_OPT_POLY(node, new_node); return new_node; @@ -189,7 +182,7 @@ ir_node *transform_polymorph_Load(ir_node *load) ir_entity *ent; ir_type *dyn_tp; - if (!(get_opt_optimize() && get_opt_dyn_meth_dispatch())) + if (!get_opt_dyn_meth_dispatch()) return load; field_ptr = get_Load_ptr(load);