| ... | ... | @@ -25678,37 +25678,20 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy |
| 25678 | 25678 | struct_field_val->type = type_info_struct_field_type; |
| 25679 | 25679 | |
| 25680 | 25680 | ZigValue **inner_fields = alloc_const_vals_ptrs(ira->codegen, 4); |
| 25681 | | inner_fields[1]->special = ConstValSpecialStatic; |
| 25682 | | inner_fields[1]->type = get_optional_type(ira->codegen, ira->codegen->builtin_types.entry_num_lit_int); |
| 25683 | | |
| 25684 | | ZigType *field_type = resolve_struct_field_type(ira->codegen, struct_field); |
| 25685 | | if (field_type == nullptr) |
| 25686 | | return ErrorSemanticAnalyzeFail; |
| 25687 | | if ((err = type_resolve(ira->codegen, field_type, ResolveStatusZeroBitsKnown))) |
| 25688 | | return err; |
| 25689 | | if (!type_has_bits(ira->codegen, struct_field->type_entry)) { |
| 25690 | | inner_fields[1]->data.x_optional = nullptr; |
| 25691 | | } else { |
| 25692 | | size_t byte_offset = struct_field->offset; |
| 25693 | | inner_fields[1]->data.x_optional = ira->codegen->pass1_arena->create<ZigValue>(); |
| 25694 | | inner_fields[1]->data.x_optional->special = ConstValSpecialStatic; |
| 25695 | | inner_fields[1]->data.x_optional->type = ira->codegen->builtin_types.entry_num_lit_int; |
| 25696 | | bigint_init_unsigned(&inner_fields[1]->data.x_optional->data.x_bigint, byte_offset); |
| 25697 | | } |
| 25698 | 25681 | |
| 25699 | | inner_fields[2]->special = ConstValSpecialStatic; |
| 25700 | | inner_fields[2]->type = ira->codegen->builtin_types.entry_type; |
| 25701 | | inner_fields[2]->data.x_type = struct_field->type_entry; |
| 25682 | inner_fields[1]->special = ConstValSpecialStatic; |
| 25683 | inner_fields[1]->type = ira->codegen->builtin_types.entry_type; |
| 25684 | inner_fields[1]->data.x_type = struct_field->type_entry; |
| 25702 | 25685 | |
| 25703 | 25686 | // default_value: anytype |
| 25704 | | inner_fields[3]->special = ConstValSpecialStatic; |
| 25705 | | inner_fields[3]->type = get_optional_type2(ira->codegen, struct_field->type_entry); |
| 25706 | | if (inner_fields[3]->type == nullptr) return ErrorSemanticAnalyzeFail; |
| 25687 | inner_fields[2]->special = ConstValSpecialStatic; |
| 25688 | inner_fields[2]->type = get_optional_type2(ira->codegen, struct_field->type_entry); |
| 25689 | if (inner_fields[2]->type == nullptr) return ErrorSemanticAnalyzeFail; |
| 25707 | 25690 | memoize_field_init_val(ira->codegen, type_entry, struct_field); |
| 25708 | 25691 | if(struct_field->init_val != nullptr && type_is_invalid(struct_field->init_val->type)){ |
| 25709 | 25692 | return ErrorSemanticAnalyzeFail; |
| 25710 | 25693 | } |
| 25711 | | set_optional_payload(inner_fields[3], struct_field->init_val); |
| 25694 | set_optional_payload(inner_fields[2], struct_field->init_val); |
| 25712 | 25695 | |
| 25713 | 25696 | ZigValue *name = create_const_str_lit(ira->codegen, struct_field->name)->data.x_ptr.data.ref.pointee; |
| 25714 | 25697 | init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(struct_field->name), true); |