authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-02-28 00:28:26-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-02-28 00:28:26-05:00
log556f22a751e47d572404992befe15c09c0f2eb0b
tree88d5964a4281f5c814717023024676539576751d
parent1b8a241f6fd1ac8d42965c6aaaf4934de565b2b2

different way of fixing previous commit

get_fn_type doesn't need the complete parameter type, it can just ensure zero bits known.

1 files changed, 4 insertions(+), 4 deletions(-)

src/analyze.cpp+4-4
......@@ -997,7 +997,7 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id) {
997997 gen_param_info->src_index = i;
998998 gen_param_info->gen_index = SIZE_MAX;
999999
1000 ensure_complete_type(g, type_entry);
1000 type_ensure_zero_bits_known(g, type_entry);
10011001 if (type_has_bits(type_entry)) {
10021002 TypeTableEntry *gen_type;
10031003 if (handle_is_ptr(type_entry)) {
......@@ -1670,9 +1670,6 @@ static void resolve_struct_type(CodeGen *g, TypeTableEntry *struct_type) {
16701670 if (struct_type->data.structure.is_invalid)
16711671 return;
16721672
1673 if (struct_type->data.structure.zero_bits_loop_flag)
1674 return;
1675
16761673 AstNode *decl_node = struct_type->data.structure.decl_node;
16771674
16781675 if (struct_type->data.structure.embedded_in_current) {
......@@ -1685,6 +1682,7 @@ static void resolve_struct_type(CodeGen *g, TypeTableEntry *struct_type) {
16851682 return;
16861683 }
16871684
1685 assert(!struct_type->data.structure.zero_bits_loop_flag);
16881686 assert(struct_type->data.structure.fields);
16891687 assert(decl_node->type == NodeTypeContainerDecl);
16901688
......@@ -2131,6 +2129,7 @@ static void resolve_enum_zero_bits(CodeGen *g, TypeTableEntry *enum_type) {
21312129
21322130 if (enum_type->data.enumeration.zero_bits_loop_flag) {
21332131 enum_type->data.enumeration.zero_bits_known = true;
2132 enum_type->data.enumeration.zero_bits_loop_flag = false;
21342133 return;
21352134 }
21362135
......@@ -2285,6 +2284,7 @@ static void resolve_struct_zero_bits(CodeGen *g, TypeTableEntry *struct_type) {
22852284 // the alignment is pointer width, then assert that the first field is within that
22862285 // alignment
22872286 struct_type->data.structure.zero_bits_known = true;
2287 struct_type->data.structure.zero_bits_loop_flag = false;
22882288 if (struct_type->data.structure.abi_alignment == 0) {
22892289 if (struct_type->data.structure.layout == ContainerLayoutPacked) {
22902290 struct_type->data.structure.abi_alignment = 1;