summaryrefslogtreecommitdiffhomepage
path: root/ir/tr
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-06-25 07:38:08 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2016-06-27 06:09:18 +0200
commitcdd69f9f04e2fac0629bafb87b77110e01a793c9 (patch)
tree82a3240df5c8ab403f28fc4fd5619fccd56d5f29 /ir/tr
parent347d5c59e1751a4a1072a2423305ac3f3ff5496e (diff)
Slightly simplify default_layout_compound_type().
'align_all' always is at least 1.
Diffstat (limited to 'ir/tr')
-rw-r--r--ir/tr/type.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ir/tr/type.c b/ir/tr/type.c
index ac7ae43..b6b0f83 100644
--- a/ir/tr/type.c
+++ b/ir/tr/type.c
@@ -1037,9 +1037,9 @@ void default_layout_compound_type(ir_type *type)
set_entity_offset(entity, offset);
}
- if (align_all > 0 && size % align_all) {
- size += align_all - (size % align_all);
- }
+ unsigned const misalign = size % align_all;
+ if (misalign != 0)
+ size += align_all - misalign;
set_type_alignment(type, align_all);
set_type_size(type, size);
set_type_state(type, layout_fixed);