Make warning about registers assigned to Phi inputs more clear.
[libfirm] / ir / be / beabi.c
index 6fb08e6..f2c3b01 100644 (file)
@@ -628,7 +628,7 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
        }
 
        /** TODO: this is not correct for cases where return values are passed
-        * on the stack, but no known ABI does this currentl...
+        * on the stack, but no known ABI does this currently...
         */
        n_reg_results = n_res;
 
@@ -2224,6 +2224,27 @@ void be_abi_put_ignore_regs(be_abi_irg_t *abi, const arch_register_class_t *cls,
                        bitset_set(bs, reg->index);
 }
 
+void be_abi_set_non_ignore_regs(be_abi_irg_t *abi, const arch_register_class_t *cls, unsigned *raw_bitset)
+{
+       unsigned         i;
+       arch_register_t *reg;
+
+       for (i = 0; i < cls->n_regs; ++i) {
+               if (arch_register_type_is(&cls->regs[i], ignore))
+                       continue;
+
+               rbitset_set(raw_bitset, i);
+       }
+
+       for (reg = pset_first(abi->ignore_regs); reg != NULL;
+            reg = pset_next(abi->ignore_regs)) {
+               if (reg->reg_class != cls)
+                       continue;
+
+               rbitset_clear(raw_bitset, reg->index);
+       }
+}
+
 /* Returns the stack layout from a abi environment. */
 const be_stack_layout_t *be_abi_get_stack_layout(const be_abi_irg_t *abi) {
        return abi->frame;