X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbearch.c;h=da4d020e80c232eaea6f606feda8faa98770e90f;hb=afbbc0b1ccd684c4c24bfd43d0f994123245f39f;hp=ce75db63072e1c33f2fdedc60f37ec4a7a323d8b;hpb=cf9c1673146d1f45d46ceb77eccfaf10fedff25d;p=libfirm diff --git a/ir/be/bearch.c b/ir/be/bearch.c index ce75db630..da4d020e8 100644 --- a/ir/be/bearch.c +++ b/ir/be/bearch.c @@ -33,7 +33,6 @@ #include "benode_t.h" #include "ircons_t.h" #include "irnode_t.h" -#include "xmalloc.h" #include "bitset.h" #include "pset.h" @@ -49,15 +48,18 @@ arch_env_t *arch_env_init(const arch_isa_if_t *isa_if, FILE *file_handle, be_mai return arch_env; } -int arch_register_class_put(const arch_register_class_t *cls, bitset_t *bs) +/** + * Put all registers in a class into a bitset. + * @param cls The class. + * @param bs The bitset. + * @return The number of registers in the class. + */ +static int arch_register_class_put(const arch_register_class_t *cls, bitset_t *bs) { - if(bs) { - int i, n; - for(i = 0, n = cls->n_regs; i < n; ++i) - bitset_set(bs, i); - } - - return cls->n_regs; + int i, n = cls->n_regs; + for (i = n - 1; i >= 0; --i) + bitset_set(bs, i); + return n; } /** @@ -332,7 +334,7 @@ extern char *arch_register_req_format(char *buf, size_t len, } } - if(arch_register_req_is(req, should_be_different)) { + if (arch_register_req_is(req, must_be_different)) { const unsigned other = req->other_different; int i;