X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbessaconstr.c;h=0533cd5fa8485c347c68b065a157d0bb2b115908;hb=30369d28b8fabe4f66cee12f42ee475d9444cf9e;hp=38c1cdc740c1d19c42e18ee400b7a50abcc2c7a3;hpb=3286ab0d9ed85761ad5d4ee1fb828c9564e9da26;p=libfirm diff --git a/ir/be/bessaconstr.c b/ir/be/bessaconstr.c index 38c1cdc74..0533cd5fa 100644 --- a/ir/be/bessaconstr.c +++ b/ir/be/bessaconstr.c @@ -101,7 +101,7 @@ static bool has_definition(const ir_node *block) static constr_info *get_or_set_info(be_ssa_construction_env_t *env, const ir_node *node) { - constr_info *info = (constr_info*)ir_nodemap_get(&env->infos, node); + constr_info *info = ir_nodemap_get(constr_info, &env->infos, node); if (info == NULL) { info = OALLOCZ(&env->obst, constr_info); ir_nodemap_insert(&env->infos, node, info); @@ -112,7 +112,7 @@ static constr_info *get_or_set_info(be_ssa_construction_env_t *env, static constr_info *get_info(const be_ssa_construction_env_t *env, const ir_node *node) { - return (constr_info*)ir_nodemap_get(&env->infos, node); + return ir_nodemap_get(constr_info, &env->infos, node); } /** @@ -297,7 +297,6 @@ static void set_operands(be_ssa_construction_env_t *env, ir_node *use, ir_node * */ static void process_block(be_ssa_construction_env_t *env, ir_node *block) { - ir_node *node; ir_node *def = NULL; constr_info *block_info = get_or_set_info(env, block); @@ -353,22 +352,17 @@ static ir_node *search_def_end_of_block(be_ssa_construction_env_t *env, } } else { - ir_node *def = NULL; - /* Search the last definition of the block. */ sched_foreach_reverse(block, def) { if (is_definition(env, def)) { constr_info *info = get_info(env, def); - def = info->u.definition; - DBG((dbg, LEVEL_3, "\t...found definition %+F\n", def)); - + DBG((dbg, LEVEL_3, "\t...found definition %+F\n", info->u.definition)); + block_info->u.last_definition = info->u.definition; break; } } - assert(def && "No definition found"); - - block_info->u.last_definition = def; + assert(block_info->u.last_definition && "No definition found"); } return block_info->u.last_definition; @@ -581,12 +575,11 @@ void be_ssa_construction_fix_users_array(be_ssa_construction_env_t *env, stat_ev_tim_push(); for (i = 0; i < nodes_len; ++i) { - const ir_edge_t *edge, *next; ir_node *value = nodes[i]; DBG((dbg, LEVEL_3, "\tfixing users of %+F\n", value)); introduce_definition(env, value); - foreach_out_edge_safe(value, edge, next) { + foreach_out_edge_safe(value, edge) { ir_node *use = get_edge_src_irn(edge); if (env->ignore_uses != NULL &&