X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Flower%2Flower_switch.c;h=97c9b31451d833bb68eb6c38bf2cb132f3076368;hb=7cf06579801b69086b3b8ee2aee61b4a5606b660;hp=800312e884dbc2c365788490a7f2bf68d816c210;hpb=1c89dc2a2c3cccd6e29fcfbf65248496db66ab92;p=libfirm diff --git a/ir/lower/lower_switch.c b/ir/lower/lower_switch.c index 800312e88..97c9b3145 100644 --- a/ir/lower/lower_switch.c +++ b/ir/lower/lower_switch.c @@ -21,7 +21,6 @@ * @file * @brief Lowering of Switches if necessary or advantageous. * @author Moritz Kroll - * @version $Id$ */ #include "config.h" @@ -166,6 +165,7 @@ static void analyse_switch1(switch_info_t *info) info->default_block = targets[pn_Switch_default]; info->cases = cases; + free(targets); } static void normalize_table(ir_node *switchn, ir_mode *new_mode, @@ -229,8 +229,8 @@ static void normalize_switch(switch_info_t *info) min_const = new_r_Const(irg, delta); selector = new_rd_Sub(dbgi, block, selector, min_const, mode); - info->switch_min = 0; info->switch_max -= info->switch_min; + info->switch_min = 0; } if (delta != NULL || change_mode) { @@ -398,8 +398,7 @@ static void create_out_of_bounds_check(switch_info_t *info) DEL_ARR_F(default_preds); - clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE - | IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS); + clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE); } /** @@ -474,9 +473,8 @@ static void find_switch_nodes(ir_node *block, void *ctx) DEL_ARR_F(info.defusers); xfree(info.cases); - clear_irg_state(get_irn_irg(block), IR_GRAPH_STATE_NO_CRITICAL_EDGES - | IR_GRAPH_STATE_CONSISTENT_DOMINANCE - | IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS); + clear_irg_properties(get_irn_irg(block), IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES + | IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE); } void lower_switch(ir_graph *irg, unsigned small_switch, unsigned spare_size,