share common phi code, fix missing phi input reqs
[libfirm] / ir / be / arm / arm_cconv.c
index da53ffd..8ca715c 100644 (file)
@@ -21,7 +21,6 @@
  * @file
  * @brief   calling convention helpers
  * @author  Matthias Braun
- * @version $Id$
  */
 #include "config.h"
 
@@ -65,17 +64,14 @@ calling_convention_t *arm_decide_calling_convention(const ir_graph *irg,
        unsigned              n_param_regs_used = 0;
        reg_or_stackslot_t   *params;
        reg_or_stackslot_t   *results;
-       int                   n_param_regs
-               = sizeof(param_regs)/sizeof(param_regs[0]);
-       int                   n_result_regs
-               = sizeof(result_regs)/sizeof(result_regs[0]);
-       int                   n_float_result_regs
-               = sizeof(float_result_regs)/sizeof(float_result_regs[0]);
-       int                   n_params;
-       int                   n_results;
-       int                   i;
-       int                   regnum;
-       int                   float_regnum;
+       size_t const          n_param_regs        = ARRAY_SIZE(param_regs);
+       size_t const          n_result_regs       = ARRAY_SIZE(result_regs);
+       size_t const          n_float_result_regs = ARRAY_SIZE(float_result_regs);
+       size_t                n_params;
+       size_t                n_results;
+       size_t                i;
+       size_t                regnum;
+       size_t                float_regnum;
        calling_convention_t *cconv;
 
        /* determine how parameters are passed */
@@ -103,7 +99,7 @@ calling_convention_t *arm_decide_calling_convention(const ir_graph *irg,
                /* we might need a 2nd 32bit component (for 64bit or double values) */
                if (bits > 32) {
                        if (bits > 64)
-                               panic("only 32 and 64bit modes supported in arm backend");
+                               panic("only 32 and 64bit modes supported");
 
                        if (regnum < n_param_regs) {
                                const arch_register_t *reg = param_regs[regnum++];
@@ -131,18 +127,18 @@ calling_convention_t *arm_decide_calling_convention(const ir_graph *irg,
 
                if (mode_is_float(result_mode)) {
                        if (float_regnum >= n_float_result_regs) {
-                               panic("Too many float results for arm backend");
+                               panic("Too many float results");
                        } else {
                                const arch_register_t *reg = float_result_regs[float_regnum++];
                                result->reg0 = reg;
                        }
                } else {
                        if (get_mode_size_bits(result_mode) > 32) {
-                               panic("Results with more than 32bits not supported by arm backend yet");
+                               panic("Results with more than 32bits not supported yet");
                        }
 
                        if (regnum >= n_result_regs) {
-                               panic("Too many results for arm backend");
+                               panic("Too many results");
                        } else {
                                const arch_register_t *reg = result_regs[regnum++];
                                result->reg0 = reg;