X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbestabs.c;h=a636a27e63221fb834097b40a707c15d29b27970;hb=89dc24503c04139bb05504059b291d6d89f99661;hp=cc68b6741cced10aa1d8194c17e5e8ce915d2861;hpb=9baf0cd6e299828073f897e4bd0a284379ad9cdb;p=libfirm diff --git a/ir/be/bestabs.c b/ir/be/bestabs.c index cc68b6741..a636a27e6 100644 --- a/ir/be/bestabs.c +++ b/ir/be/bestabs.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -353,7 +353,8 @@ static void gen_struct_union_type(wenv_t *env, ir_type *tp) { for (i = 0, n = get_compound_n_members(tp); i < n; ++i) { ir_entity *ent = get_compound_member(tp, i); ir_type *mtp = get_entity_type(ent); - int ofs, size; + int ofs; + unsigned size; if (! IS_TYPE_READY(mtp)) waitq_put(env->wq, mtp); @@ -368,11 +369,11 @@ static void gen_struct_union_type(wenv_t *env, ir_type *tp) { int bofs; type_num = get_type_number(h, tp); - size = get_type_size_bits(tp); + size = get_type_size_bytes(tp) * 8; bofs = (ofs + get_entity_offset(ent)) * 8 + get_entity_offset_bits_remainder(ent); /* name:type, bit offset from the start of the struct', number of bits in the element. */ - fprintf(h->f, "%s:%u,%d,%d;", get_entity_name(ent), type_num, bofs, size); + fprintf(h->f, "%s:%u,%d,%u;", get_entity_name(ent), type_num, bofs, size); } } else { /* no bitfield */ @@ -390,8 +391,8 @@ static void gen_struct_union_type(wenv_t *env, ir_type *tp) { /* name:type, bit offset from the start of the struct', number of bits in the element. */ fprintf(h->f, "%u", type_num); } - size = get_type_size_bits(mtp); - fprintf(h->f, ",%d,%d;", ofs * 8, size); + size = get_type_size_bytes(mtp) * 8; + fprintf(h->f, ",%d,%u;", ofs * 8, size); } } fprintf(h->f, ";\",%d,0,0,0\n", N_LSYM);