summaryrefslogtreecommitdiffhomepage
path: root/ir/tr
diff options
context:
space:
mode:
authorAndreas Zwinkau <zwinkau@kit.edu>2015-12-18 15:42:28 +0100
committerAndreas Zwinkau <zwinkau@kit.edu>2015-12-18 15:46:38 +0100
commitef3242f0e5f6fb7d0bb580565e07aae5d4a66256 (patch)
treeac630fea00300cd89f6409e796800a0530f4b6c3 /ir/tr
parent755f9742b062c4d3d3cb75e50c10c2044de7cfa8 (diff)
Refactor for less indentation
Diffstat (limited to 'ir/tr')
-rw-r--r--ir/tr/type.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/ir/tr/type.c b/ir/tr/type.c
index 6d4f45e..9202668 100644
--- a/ir/tr/type.c
+++ b/ir/tr/type.c
@@ -972,17 +972,18 @@ void remove_compound_member(ir_type *type, ir_entity *member)
{
assert(is_compound_type(type));
for (size_t i = 0, n = ARR_LEN(type->attr.ca.members); i < n; ++i) {
- if (get_compound_member(type, i) == member) {
- for (; i < n - 1; ++i)
- type->attr.ca.members[i] = type->attr.ca.members[i+1];
- ARR_SETLEN(ir_entity*, type->attr.ca.members, n-1);
- if (is_segment_type(type) && !(type->flags & tf_info)
- && get_entity_visibility(member) != ir_visibility_private) {
- pmap *globals = irp->globals;
- pmap_insert(globals, get_entity_ld_ident(member), NULL);
- }
- break;
+ if (get_compound_member(type, i) != member)
+ continue;
+ for (; i < n - 1; ++i)
+ type->attr.ca.members[i] = type->attr.ca.members[i+1];
+ ARR_SETLEN(ir_entity*, type->attr.ca.members, n-1);
+ /* members of global type must also be removed from map */
+ if (is_segment_type(type) && !(type->flags & tf_info)
+ && get_entity_visibility(member) != ir_visibility_private) {
+ pmap *globals = irp->globals;
+ pmap_insert(globals, get_entity_ld_ident(member), NULL);
}
+ break;
}
}