X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbearch.c;h=942e7f51d0ad78969c769e80cd35a0a0cbf324f9;hb=a4c23fb5fdcaf600f18b4fa7b7e104fa9b7dc514;hp=45c15fd8b479ef9df5653d2a8a6efb07eb919105;hpb=78680bc76e5e6d7c8a63390fefdf085b342d1b6d;p=libfirm diff --git a/ir/be/bearch.c b/ir/be/bearch.c index 45c15fd8b..942e7f51d 100644 --- a/ir/be/bearch.c +++ b/ir/be/bearch.c @@ -49,15 +49,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; } /**