Adapt to coding conventions.
[libfirm] / ir / lower / lower_intrinsics.c
index 946a6c8..1ca8bfb 100644 (file)
@@ -37,7 +37,7 @@
 #include "irgmod.h"
 #include "irgopt.h"
 #include "trouts.h"
-#include "irvrfy.h"
+#include "irverify.h"
 #include "pmap.h"
 #include "array_t.h"
 #include "irpass_t.h"
@@ -149,7 +149,7 @@ unsigned lower_intrinsics(i_record *list, int length, int part_block_used)
                        set_trouts_inconsistent();
 
                        /* verify here */
-                       irg_verify(irg, VRFY_NORMAL);
+                       irg_verify(irg, VERIFY_NORMAL);
 
                        /* Optimize it, tuple might be created. */
                        optimize_graph_df(irg);
@@ -266,7 +266,7 @@ int i_mapper_bswap(ir_node *call, void *ctx)
        irn = new_rd_Builtin(dbg, block, get_irg_no_mem(current_ir_graph), 1, &op, ir_bk_bswap, tp);
        set_irn_pinned(irn, op_pin_state_floats);
        DBG_OPT_ALGSIM0(call, irn, FS_OPT_RTS_ABS);
-       irn = new_r_Proj(block, irn, get_irn_mode(op), pn_Builtin_1_result);
+       irn = new_r_Proj(irn, get_irn_mode(op), pn_Builtin_1_result);
        replace_call(irn, call, mem, NULL, NULL);
        return 1;
 }  /* i_mapper_bswap */
@@ -291,10 +291,10 @@ int i_mapper_alloca(ir_node *call, void *ctx)
        }
 
        irn    = new_rd_Alloc(dbg, block, mem, op, firm_unknown_type, stack_alloc);
-       mem    = new_rd_Proj(dbg, block, irn, mode_M, pn_Alloc_M);
-       no_exc = new_rd_Proj(dbg, block, irn, mode_X, pn_Alloc_X_regular);
-       exc    = new_rd_Proj(dbg, block, irn, mode_X, pn_Alloc_X_except);
-       irn    = new_rd_Proj(dbg, block, irn, get_modeP_data(), pn_Alloc_res);
+       mem    = new_rd_Proj(dbg, irn, mode_M, pn_Alloc_M);
+       no_exc = new_rd_Proj(dbg, irn, mode_X, pn_Alloc_X_regular);
+       exc    = new_rd_Proj(dbg, irn, mode_X, pn_Alloc_X_except);
+       irn    = new_rd_Proj(dbg, irn, get_modeP_data(), pn_Alloc_res);
 
        DBG_OPT_ALGSIM0(call, irn, FS_OPT_RTS_ALLOCA);
        replace_call(irn, call, mem, no_exc, exc);
@@ -388,10 +388,10 @@ int i_mapper_pow(ir_node *call, void *ctx)
 
                irn  = new_Const(get_mode_one(mode));
                quot = new_rd_Quot(dbg, block, mem, irn, left, mode, op_pin_state_pinned);
-               mem  = new_r_Proj(block, quot, mode_M, pn_Quot_M);
-               irn  = new_r_Proj(block, quot, mode, pn_Quot_res);
-               reg_jmp = new_r_Proj(block, quot, mode_X, pn_Quot_X_regular);
-               exc_jmp = new_r_Proj(block, quot, mode_X, pn_Quot_X_except);
+               mem  = new_r_Proj(quot, mode_M, pn_Quot_M);
+               irn  = new_r_Proj(quot, mode, pn_Quot_res);
+               reg_jmp = new_r_Proj(quot, mode_X, pn_Quot_X_regular);
+               exc_jmp = new_r_Proj(quot, mode_X, pn_Quot_X_except);
        }
        DBG_OPT_ALGSIM0(call, irn, FS_OPT_RTS_POW);
        replace_call(irn, call, mem, reg_jmp, exc_jmp);
@@ -639,7 +639,7 @@ static ir_node *eval_strlen(ir_entity *ent, ir_type *res_tp)
                return NULL;
 
        if (!has_entity_initializer(ent)) {
-               int len;
+               int len = 0;
                int n;
                int i = -1;
 
@@ -753,6 +753,7 @@ static ir_node *eval_strcmp(ir_entity *left, ir_entity *right, ir_type *res_tp)
                n_r = get_compound_ent_n_values(right);
                if (n_r < n)
                        n = n_r;
+               res = 0;
                for (i = 0; i < n; ++i) {
                        ir_node *irn;
                        long v_l, v_r;
@@ -908,10 +909,10 @@ replace_by_call:
 
                        /* replace the strcmp by (*x) */
                        irn = new_rd_Load(dbg, block, mem, v, mode, 0);
-                       mem = new_r_Proj(block, irn, mode_M, pn_Load_M);
-                       exc = new_r_Proj(block, irn, mode_X, pn_Load_X_except);
-                       reg = new_r_Proj(block, irn, mode_X, pn_Load_X_regular);
-                       irn = new_r_Proj(block, irn, mode, pn_Load_res);
+                       mem = new_r_Proj(irn, mode_M, pn_Load_M);
+                       exc = new_r_Proj(irn, mode_X, pn_Load_X_except);
+                       reg = new_r_Proj(irn, mode_X, pn_Load_X_regular);
+                       irn = new_r_Proj(irn, mode, pn_Load_res);
 
                        /* conv to the result mode */
                        mode = get_type_mode(res_tp);
@@ -1191,7 +1192,7 @@ int i_mapper_RuntimeCall(ir_node *node, runtime_rt *rt)
        set_irn_pinned(call, get_irn_pinned(node));
 
        if (n_res > 0)
-               res_proj = new_r_Proj(bl, call, mode_T, pn_Call_T_result);
+               res_proj = new_r_Proj(call, mode_T, pn_Call_T_result);
        else
                res_proj = NULL;
 
@@ -1204,29 +1205,29 @@ int i_mapper_RuntimeCall(ir_node *node, runtime_rt *rt)
                for (i = 0; i < n_proj; ++i)
                        set_Tuple_pred(node, i, new_r_Bad(irg));
                if (rt->mem_proj_nr >= 0)
-                       set_Tuple_pred(node, rt->mem_proj_nr, new_r_Proj(bl, call, mode_M, pn_Call_M));
+                       set_Tuple_pred(node, rt->mem_proj_nr, new_r_Proj(call, mode_M, pn_Call_M));
                if (!is_NoMem(mem)) {
                        /* Exceptions can only be handled with real memory */
                        if (rt->regular_proj_nr >= 0)
-                               set_Tuple_pred(node, rt->regular_proj_nr, new_r_Proj(bl, call, mode_X, pn_Call_X_regular));
+                               set_Tuple_pred(node, rt->regular_proj_nr, new_r_Proj(call, mode_X, pn_Call_X_regular));
                        if (rt->exc_proj_nr >= 0)
-                               set_Tuple_pred(node, rt->exc_proj_nr, new_r_Proj(bl, call, mode_X, pn_Call_X_except));
+                               set_Tuple_pred(node, rt->exc_proj_nr, new_r_Proj(call, mode_X, pn_Call_X_except));
                        if (rt->exc_mem_proj_nr >= 0)
-                               set_Tuple_pred(node, rt->mem_proj_nr, new_r_Proj(bl, call, mode_M, pn_Call_M));
+                               set_Tuple_pred(node, rt->mem_proj_nr, new_r_Proj(call, mode_M, pn_Call_M));
                }
 
                if (rt->res_proj_nr >= 0)
                        for (i = 0; i < n_res; ++i)
                                set_Tuple_pred(node, rt->res_proj_nr + i,
-                               new_r_Proj(bl, res_proj, get_type_mode(get_method_res_type(mtp, i)), i));
+                               new_r_Proj(res_proj, get_type_mode(get_method_res_type(mtp, i)), i));
                        return 1;
        } else {
                /* only one return value supported */
                if (n_res > 0) {
                        ir_mode *mode = get_type_mode(get_method_res_type(mtp, 0));
 
-                       res_proj = new_r_Proj(bl, call, mode_T, pn_Call_T_result);
-                       res_proj = new_r_Proj(bl, res_proj, mode, 0);
+                       res_proj = new_r_Proj(call, mode_T, pn_Call_T_result);
+                       res_proj = new_r_Proj(res_proj, mode, 0);
 
                        exchange(node, res_proj);
                        return 1;