| ... | @@ -25029,7 +25029,7 @@ static ZigValue *create_ptr_like_type_info(IrAnalyze *ira, IrInst *source_instr, | ... | @@ -25029,7 +25029,7 @@ static ZigValue *create_ptr_like_type_info(IrAnalyze *ira, IrInst *source_instr, |
| 25029 | fields[2]->data.x_bool = attrs_type->data.pointer.is_volatile; | 25029 | fields[2]->data.x_bool = attrs_type->data.pointer.is_volatile; |
| 25030 | // alignment: u32 | 25030 | // alignment: u32 |
| 25031 | ensure_field_index(result->type, "alignment", 3); | 25031 | ensure_field_index(result->type, "alignment", 3); |
| 25032 | fields[3]->type = ira->codegen->builtin_types.entry_num_lit_int; | 25032 | fields[3]->type = ira->codegen->builtin_types.entry_u29; |
| 25033 | if (attrs_type->data.pointer.explicit_alignment != 0) { | 25033 | if (attrs_type->data.pointer.explicit_alignment != 0) { |
| 25034 | fields[3]->special = ConstValSpecialStatic; | 25034 | fields[3]->special = ConstValSpecialStatic; |
| 25035 | bigint_init_unsigned(&fields[3]->data.x_bigint, attrs_type->data.pointer.explicit_alignment); | 25035 | bigint_init_unsigned(&fields[3]->data.x_bigint, attrs_type->data.pointer.explicit_alignment); |
| ... | @@ -25740,6 +25740,17 @@ static Error get_const_field_bool(IrAnalyze *ira, AstNode *source_node, ZigValue | ... | @@ -25740,6 +25740,17 @@ static Error get_const_field_bool(IrAnalyze *ira, AstNode *source_node, ZigValue |
| 25740 | return ErrorNone; | 25740 | return ErrorNone; |
| 25741 | } | 25741 | } |
| 25742 | | 25742 | |
| | 25743 | static Error get_const_field_u29(IrAnalyze *ira, AstNode *source_node, ZigValue *struct_value, |
| | 25744 | const char *name, size_t field_index, uint32_t *out) |
| | 25745 | { |
| | 25746 | ZigValue *value = get_const_field(ira, source_node, struct_value, name, field_index); |
| | 25747 | if (value == nullptr) |
| | 25748 | return ErrorSemanticAnalyzeFail; |
| | 25749 | assert(value->type == ira->codegen->builtin_types.entry_u29); |
| | 25750 | *out = bigint_as_u32(&value->data.x_bigint); |
| | 25751 | return ErrorNone; |
| | 25752 | } |
| | 25753 | |
| 25743 | static BigInt *get_const_field_lit_int(IrAnalyze *ira, AstNode *source_node, ZigValue *struct_value, const char *name, size_t field_index) | 25754 | static BigInt *get_const_field_lit_int(IrAnalyze *ira, AstNode *source_node, ZigValue *struct_value, const char *name, size_t field_index) |
| 25744 | { | 25755 | { |
| 25745 | ZigValue *value = get_const_field(ira, source_node, struct_value, name, field_index); | 25756 | ZigValue *value = get_const_field(ira, source_node, struct_value, name, field_index); |
| ... | @@ -25868,8 +25879,9 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI | ... | @@ -25868,8 +25879,9 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI |
| 25868 | buf_sprintf("sentinels are only allowed on slices and unknown-length pointers")); | 25879 | buf_sprintf("sentinels are only allowed on slices and unknown-length pointers")); |
| 25869 | return ira->codegen->invalid_inst_gen->value->type; | 25880 | return ira->codegen->invalid_inst_gen->value->type; |
| 25870 | } | 25881 | } |
| 25871 | BigInt *bi = get_const_field_lit_int(ira, source_instr->source_node, payload, "alignment", 3); | 25882 | |
| 25872 | if (bi == nullptr) | 25883 | uint32_t alignment; |
| | 25884 | if ((err = get_const_field_u29(ira, source_instr->source_node, payload, "alignment", 3, &alignment))) |
| 25873 | return ira->codegen->invalid_inst_gen->value->type; | 25885 | return ira->codegen->invalid_inst_gen->value->type; |
| 25874 | | 25886 | |
| 25875 | bool is_const; | 25887 | bool is_const; |
| ... | @@ -25896,7 +25908,7 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI | ... | @@ -25896,7 +25908,7 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI |
| 25896 | is_const, | 25908 | is_const, |
| 25897 | is_volatile, | 25909 | is_volatile, |
| 25898 | ptr_len, | 25910 | ptr_len, |
| 25899 | bigint_as_u32(bi), | 25911 | alignment, |
| 25900 | 0, // bit_offset_in_host | 25912 | 0, // bit_offset_in_host |
| 25901 | 0, // host_int_bytes | 25913 | 0, // host_int_bytes |
| 25902 | is_allowzero, | 25914 | is_allowzero, |