ia32: cleanup handling of 8/16bit operations
[libfirm] / ir / be / bessaconstr.c
index 38c1cdc..0533cd5 100644 (file)
@@ -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 &&