X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeabi.c;h=f2c3b01d5b70daa266b81e076b30f4d983b0536c;hb=3f807bf48426a29da4129ff29c44a4b4690c45f6;hp=6fb08e60a58c6227f972978f3514467bb16fdfb0;hpb=2d9776010c3f48b99e88e4199f201ba8531dbde8;p=libfirm diff --git a/ir/be/beabi.c b/ir/be/beabi.c index 6fb08e60a..f2c3b01d5 100644 --- a/ir/be/beabi.c +++ b/ir/be/beabi.c @@ -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;