Add arch_get_register_req_out().
[libfirm] / ir / be / benode.c
index 2618599..7c511ee 100644 (file)
@@ -257,7 +257,7 @@ static int Call_cmp_attr(ir_node *a, ir_node *b) {
        return _node_cmp_attr(&a_attr->node_attr, &b_attr->node_attr);
 }
 
-static INLINE be_req_t *get_be_req(const ir_node *node, int pos)
+static inline be_req_t *get_be_req(const ir_node *node, int pos)
 {
        int idx;
        const be_node_attr_t *attr;
@@ -278,7 +278,7 @@ static INLINE be_req_t *get_be_req(const ir_node *node, int pos)
        return pos < 0 ? &rd->req : &rd->in_req;
 }
 
-static INLINE arch_register_req_t *get_req(const ir_node *node, int pos)
+static inline arch_register_req_t *get_req(const ir_node *node, int pos)
 {
        be_req_t *bereq = get_be_req(node, pos);
        return &bereq->req;
@@ -1106,6 +1106,7 @@ be_node_get_irn_reg_req(const ir_node *irn, int pos)
                if (get_irn_mode(irn) == mode_T)
                        return arch_no_register_req;
 
+               assert(pos == -1);
                out_pos = redir_proj((const ir_node **)&irn);
                assert(is_be_node(irn));
                return get_out_reg_req(irn, out_pos);
@@ -1153,12 +1154,10 @@ restart:
                                irn = get_Proj_pred(irn);
                        }
                        goto restart;
-                       break;
+
                default:
                        return 0;
        }
-
-       return 0;
 }
 
 static arch_irn_flags_t be_node_get_flags(const ir_node *node)
@@ -1255,7 +1254,7 @@ static struct {
 
 #define get_phi_handler_from_ops(h)      container_of(h, phi_handler_t, irn_ops)
 
-static INLINE
+static inline
 phi_attr_t *get_Phi_attr(const ir_node *phi)
 {
        phi_attr_t *attr = pmap_get(phi_handler.phi_attrs, (void*) phi);
@@ -1289,7 +1288,7 @@ const arch_register_req_t *get_Phi_reg_req_recursive(const ir_node *phi,
                /* Matze: don't we unnecessary constraint our phis with this?
                 * we only need to take the regclass IMO*/
                if(!is_Phi(op))
-                       return arch_get_register_req(op, BE_OUT_POS(0));
+                       return arch_get_register_req_out(op);
        }
 
        /*