X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftype.c;h=32880488ccf0ab1bdc0479d8db2fd243f0813be4;hb=d2dc2564b47d9c113d7e6e598574e9733627fcca;hp=7c8a2498b4588dc6c9dc3caa6f116e0aa5d4d547;hpb=45a2de08053e946acbd4ae609b1e37fd890215a5;p=libfirm diff --git a/ir/tr/type.c b/ir/tr/type.c index 7c8a2498b..32880488c 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -361,7 +361,7 @@ int get_type_alignment_bits(ir_type *tp) { void set_type_alignment_bits(ir_type *tp, int align) { assert(tp && tp->kind == k_type); - assert((align & (align - 1)) == 0 && "type alignment not power of two"); + assert((align == -1 || (align & (align - 1)) == 0) && "type alignment not power of two"); /* Methods don't have an alignment. */ if (tp->type_op != type_method) { tp->align = align; @@ -370,7 +370,11 @@ set_type_alignment_bits(ir_type *tp, int align) { void set_type_alignment_bytes(ir_type *tp, int align) { - set_type_alignment_bits(tp, 8*align); + if (align == -1) { + set_type_alignment_bits(tp, -1); + } else { + set_type_alignment_bits(tp, 8*align); + } } /* Returns a human readable string for the enum entry. */ @@ -1515,6 +1519,7 @@ void free_array_attrs (ir_type *array) { assert(array && (array->type_op == type_array)); free(array->attr.aa.lower_bound); free(array->attr.aa.upper_bound); + free(array->attr.aa.order); } /* manipulate private fields of array ir_type */ @@ -1947,8 +1952,8 @@ entity *frame_alloc_area(type *frame_type, int size, int alignment, int at_start static unsigned area_cnt = 0; static ir_type *a_byte = NULL; - assert(is_frame_type(tp)); - assert(get_type_state(tp) == layout_fixed); + assert(is_frame_type(frame_type)); + assert(get_type_state(frame_type) == layout_fixed); if (! a_byte) a_byte = new_type_primitive(new_id_from_chars("byte", 4), mode_Bu);