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;
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. */
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);