beifg: Let be_ifg_foreach_neighbour() declare the node variable.
[libfirm] / ir / be / beabi.c
index 2bf684a..99868f2 100644 (file)
@@ -110,7 +110,7 @@ static void be_abi_reg_map_set(pmap *map, const arch_register_t* reg,
 }
 
 /**
- * Check if the given register is callee save, ie. will be saved by the callee.
+ * Check if the given register is callee save, i.e. will be saved by the callee.
  */
 static bool arch_register_is_callee_save(
        const arch_env_t      *arch_env,
@@ -122,7 +122,7 @@ static bool arch_register_is_callee_save(
 }
 
 /**
- * Check if the given register is caller save, ie. must be saved by the caller.
+ * Check if the given register is caller save, i.e. must be saved by the caller.
  */
 static bool arch_register_is_caller_save(
        const arch_env_t      *arch_env,
@@ -505,12 +505,8 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
                        continue;
 
                foreach_out_edge(irn, res_edge) {
-                       int proj;
-                       ir_node *res = get_edge_src_irn(res_edge);
-
-                       assert(is_Proj(res));
-
-                       proj = get_Proj_proj(res);
+                       ir_node *const res  = get_edge_src_irn(res_edge);
+                       long     const proj = get_Proj_proj(res);
                        assert(proj < n_res);
                        assert(res_projs[proj] == NULL);
                        res_projs[proj] = res;
@@ -545,14 +541,14 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
        throws_exception = ir_throws_exception(irn);
        if (env->call->flags.call_has_imm && is_SymConst(call_ptr)) {
                /* direct call */
-               low_call = be_new_Call(dbgi, irg, bl, curr_mem, sp->single_req, curr_sp,
+               low_call = be_new_Call(dbgi, bl, curr_mem, sp->single_req, curr_sp,
                                       sp->single_req, curr_sp,
                                       n_reg_results + pn_be_Call_first_res + ARR_LEN(destroyed_regs),
                                       n_ins, in, get_Call_type(irn));
                be_Call_set_entity(low_call, get_SymConst_entity(call_ptr));
        } else {
                /* indirect call */
-               low_call = be_new_Call(dbgi, irg, bl, curr_mem, sp->single_req, curr_sp,
+               low_call = be_new_Call(dbgi, bl, curr_mem, sp->single_req, curr_sp,
                                       sp->reg_class->class_req, call_ptr,
                                       n_reg_results + pn_be_Call_first_res + ARR_LEN(destroyed_regs),
                                       n_ins, in, get_Call_type(irn));
@@ -775,7 +771,6 @@ static ir_node *adjust_alloc(be_abi_irg_t *env, ir_node *alloc, ir_node *curr_sp
        foreach_out_edge(alloc, edge) {
                ir_node *irn = get_edge_src_irn(edge);
 
-               assert(is_Proj(irn));
                switch (get_Proj_proj(irn)) {
                case pn_Alloc_M:
                        alloc_mem = irn;
@@ -1256,7 +1251,7 @@ static ir_node *create_be_return(be_abi_irg_t *const env, ir_node *const irn)
 
        /* The in array for the new back end return is now ready. */
        dbg_info *const dbgi = get_irn_dbg_info(irn);
-       ir_node  *const ret  = be_new_Return(dbgi, irg, bl, n_res, call->pop, n, in);
+       ir_node  *const ret  = be_new_Return(dbgi, bl, n_res, call->pop, n, in);
 
        /* Set the register classes of the return's parameter accordingly. */
        for (i = 0; i < n; ++i) {