authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-08-25 03:33:25-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-08-25 03:40:47-04:00
logb95ff12f2fb4aa5c20aecb789a91396557662287
tree4592adf93c28cc06897f69991e6d3ca619f316f6
parentac36f98e72f7ef33346bc772e4f257b79d04fcff

fix regressions


2 files changed, 102 insertions(+), 90 deletions(-)

src/analyze.cpp+16-2
......@@ -1739,6 +1739,9 @@ bool type_is_invalid(TypeTableEntry *type_entry) {
17391739static Error resolve_enum_type(CodeGen *g, TypeTableEntry *enum_type) {
17401740 assert(enum_type->id == TypeTableEntryIdEnum);
17411741
1742 if (enum_type->data.enumeration.is_invalid)
1743 return ErrorSemanticAnalyzeFail;
1744
17421745 if (enum_type->data.enumeration.complete)
17431746 return ErrorNone;
17441747
......@@ -2536,7 +2539,9 @@ static Error resolve_enum_zero_bits(CodeGen *g, TypeTableEntry *enum_type) {
25362539 enum_type->data.enumeration.zero_bits_loop_flag = false;
25372540 enum_type->zero_bits = !type_has_bits(tag_int_type);
25382541 enum_type->data.enumeration.zero_bits_known = true;
2539 assert(!enum_type->data.enumeration.is_invalid);
2542
2543 if (enum_type->data.enumeration.is_invalid)
2544 return ErrorSemanticAnalyzeFail;
25402545
25412546 return ErrorNone;
25422547}
......@@ -2546,6 +2551,9 @@ static Error resolve_struct_zero_bits(CodeGen *g, TypeTableEntry *struct_type) {
25462551
25472552 Error err;
25482553
2554 if (struct_type->data.structure.is_invalid)
2555 return ErrorSemanticAnalyzeFail;
2556
25492557 if (struct_type->data.structure.zero_bits_known)
25502558 return ErrorNone;
25512559
......@@ -2662,6 +2670,9 @@ static Error resolve_union_zero_bits(CodeGen *g, TypeTableEntry *union_type) {
26622670
26632671 Error err;
26642672
2673 if (union_type->data.unionation.is_invalid)
2674 return ErrorSemanticAnalyzeFail;
2675
26652676 if (union_type->data.unionation.zero_bits_known)
26662677 return ErrorNone;
26672678
......@@ -2992,7 +3003,10 @@ static Error resolve_union_zero_bits(CodeGen *g, TypeTableEntry *union_type) {
29923003 union_type->data.unionation.gen_field_count = gen_field_index;
29933004 union_type->zero_bits = (gen_field_index == 0 && (field_count < 2 || !src_have_tag));
29943005 union_type->data.unionation.zero_bits_known = true;
2995 assert(!union_type->data.unionation.is_invalid);
3006
3007 if (union_type->data.unionation.is_invalid)
3008 return ErrorSemanticAnalyzeFail;
3009
29963010 return ErrorNone;
29973011}
29983012
src/ir.cpp+86-88
......@@ -15272,6 +15272,8 @@ static TypeTableEntry *ir_analyze_instruction_slice_type(IrAnalyze *ira,
1527215272 return ira->codegen->builtin_types.entry_invalid;
1527315273
1527415274 if (slice_type_instruction->align_value == nullptr) {
15275 if ((err = type_ensure_zero_bits_known(ira->codegen, child_type)))
15276 return ira->codegen->builtin_types.entry_invalid;
1527515277 align_bytes = get_abi_alignment(ira->codegen, child_type);
1527615278 }
1527715279
......@@ -16751,19 +16753,15 @@ static void ensure_field_index(TypeTableEntry *type, const char *field_name, siz
1675116753 (buf_deinit(field_name_buf), true));
1675216754}
1675316755
16754static TypeTableEntry *ir_type_info_get_type(IrAnalyze *ira, const char *type_name, TypeTableEntry *root = nullptr)
16755{
16756static TypeTableEntry *ir_type_info_get_type(IrAnalyze *ira, const char *type_name, TypeTableEntry *root) {
1675616757 Error err;
1675716758 static ConstExprValue *type_info_var = nullptr;
1675816759 static TypeTableEntry *type_info_type = nullptr;
16759 if (type_info_var == nullptr)
16760 {
16760 if (type_info_var == nullptr) {
1676116761 type_info_var = get_builtin_value(ira->codegen, "TypeInfo");
1676216762 assert(type_info_var->type->id == TypeTableEntryIdMetaType);
1676316763
16764 if ((err = ensure_complete_type(ira->codegen, type_info_var->data.x_type)))
16765 return ira->codegen->builtin_types.entry_invalid;
16766
16764 assertNoError(ensure_complete_type(ira->codegen, type_info_var->data.x_type));
1676716765 type_info_type = type_info_var->data.x_type;
1676816766 assert(type_info_type->id == TypeTableEntryIdUnion);
1676916767 }
......@@ -16797,7 +16795,7 @@ static TypeTableEntry *ir_type_info_get_type(IrAnalyze *ira, const char *type_na
1679716795static bool ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, ScopeDecls *decls_scope)
1679816796{
1679916797 Error err;
16800 TypeTableEntry *type_info_definition_type = ir_type_info_get_type(ira, "Definition");
16798 TypeTableEntry *type_info_definition_type = ir_type_info_get_type(ira, "Definition", nullptr);
1680116799 if ((err = ensure_complete_type(ira->codegen, type_info_definition_type)))
1680216800 return false;
1680316801
......@@ -16951,7 +16949,7 @@ static bool ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, Scop
1695116949 // calling_convention: TypeInfo.CallingConvention
1695216950 ensure_field_index(fn_def_val->type, "calling_convention", 2);
1695316951 fn_def_fields[2].special = ConstValSpecialStatic;
16954 fn_def_fields[2].type = ir_type_info_get_type(ira, "CallingConvention");
16952 fn_def_fields[2].type = ir_type_info_get_type(ira, "CallingConvention", nullptr);
1695516953 bigint_init_unsigned(&fn_def_fields[2].data.x_enum_tag, fn_node->cc);
1695616954 // is_var_args: bool
1695716955 ensure_field_index(fn_def_val->type, "is_var_args", 3);
......@@ -17051,6 +17049,61 @@ static bool ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, Scop
1705117049 return true;
1705217050}
1705317051
17052static ConstExprValue *create_ptr_like_type_info(IrAnalyze *ira, TypeTableEntry *ptr_type_entry) {
17053 TypeTableEntry *attrs_type;
17054 uint32_t size_enum_index;
17055 if (is_slice(ptr_type_entry)) {
17056 attrs_type = ptr_type_entry->data.structure.fields[slice_ptr_index].type_entry;
17057 size_enum_index = 2;
17058 } else if (ptr_type_entry->id == TypeTableEntryIdPointer) {
17059 attrs_type = ptr_type_entry;
17060 size_enum_index = (ptr_type_entry->data.pointer.ptr_len == PtrLenSingle) ? 0 : 1;
17061 } else {
17062 zig_unreachable();
17063 }
17064
17065 TypeTableEntry *type_info_pointer_type = ir_type_info_get_type(ira, "Pointer", nullptr);
17066 assertNoError(ensure_complete_type(ira->codegen, type_info_pointer_type));
17067
17068 ConstExprValue *result = create_const_vals(1);
17069 result->special = ConstValSpecialStatic;
17070 result->type = type_info_pointer_type;
17071
17072 ConstExprValue *fields = create_const_vals(5);
17073 result->data.x_struct.fields = fields;
17074
17075 // size: Size
17076 ensure_field_index(result->type, "size", 0);
17077 TypeTableEntry *type_info_pointer_size_type = ir_type_info_get_type(ira, "Size", type_info_pointer_type);
17078 assertNoError(ensure_complete_type(ira->codegen, type_info_pointer_size_type));
17079 fields[0].special = ConstValSpecialStatic;
17080 fields[0].type = type_info_pointer_size_type;
17081 bigint_init_unsigned(&fields[0].data.x_enum_tag, size_enum_index);
17082
17083 // is_const: bool
17084 ensure_field_index(result->type, "is_const", 1);
17085 fields[1].special = ConstValSpecialStatic;
17086 fields[1].type = ira->codegen->builtin_types.entry_bool;
17087 fields[1].data.x_bool = attrs_type->data.pointer.is_const;
17088 // is_volatile: bool
17089 ensure_field_index(result->type, "is_volatile", 2);
17090 fields[2].special = ConstValSpecialStatic;
17091 fields[2].type = ira->codegen->builtin_types.entry_bool;
17092 fields[2].data.x_bool = attrs_type->data.pointer.is_volatile;
17093 // alignment: u32
17094 ensure_field_index(result->type, "alignment", 3);
17095 fields[3].special = ConstValSpecialStatic;
17096 fields[3].type = ira->codegen->builtin_types.entry_u32;
17097 bigint_init_unsigned(&fields[3].data.x_bigint, attrs_type->data.pointer.alignment);
17098 // child: type
17099 ensure_field_index(result->type, "child", 4);
17100 fields[4].special = ConstValSpecialStatic;
17101 fields[4].type = ira->codegen->builtin_types.entry_type;
17102 fields[4].data.x_type = attrs_type->data.pointer.child_type;
17103
17104 return result;
17105};
17106
1705417107static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *type_entry) {
1705517108 Error err;
1705617109 assert(type_entry != nullptr);
......@@ -17076,61 +17129,6 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1707617129 enum_field_val->data.x_struct.fields = inner_fields;
1707717130 };
1707817131
17079 const auto create_ptr_like_type_info = [ira](TypeTableEntry *ptr_type_entry) {
17080 TypeTableEntry *attrs_type;
17081 uint32_t size_enum_index;
17082 if (is_slice(ptr_type_entry)) {
17083 attrs_type = ptr_type_entry->data.structure.fields[slice_ptr_index].type_entry;
17084 size_enum_index = 2;
17085 } else if (ptr_type_entry->id == TypeTableEntryIdPointer) {
17086 attrs_type = ptr_type_entry;
17087 size_enum_index = (ptr_type_entry->data.pointer.ptr_len == PtrLenSingle) ? 0 : 1;
17088 } else {
17089 zig_unreachable();
17090 }
17091
17092 TypeTableEntry *type_info_pointer_type = ir_type_info_get_type(ira, "Pointer");
17093 assertNoError(ensure_complete_type(ira->codegen, type_info_pointer_type));
17094
17095 ConstExprValue *result = create_const_vals(1);
17096 result->special = ConstValSpecialStatic;
17097 result->type = type_info_pointer_type;
17098
17099 ConstExprValue *fields = create_const_vals(5);
17100 result->data.x_struct.fields = fields;
17101
17102 // size: Size
17103 ensure_field_index(result->type, "size", 0);
17104 TypeTableEntry *type_info_pointer_size_type = ir_type_info_get_type(ira, "Size", type_info_pointer_type);
17105 assertNoError(ensure_complete_type(ira->codegen, type_info_pointer_size_type));
17106 fields[0].special = ConstValSpecialStatic;
17107 fields[0].type = type_info_pointer_size_type;
17108 bigint_init_unsigned(&fields[0].data.x_enum_tag, size_enum_index);
17109
17110 // is_const: bool
17111 ensure_field_index(result->type, "is_const", 1);
17112 fields[1].special = ConstValSpecialStatic;
17113 fields[1].type = ira->codegen->builtin_types.entry_bool;
17114 fields[1].data.x_bool = attrs_type->data.pointer.is_const;
17115 // is_volatile: bool
17116 ensure_field_index(result->type, "is_volatile", 2);
17117 fields[2].special = ConstValSpecialStatic;
17118 fields[2].type = ira->codegen->builtin_types.entry_bool;
17119 fields[2].data.x_bool = attrs_type->data.pointer.is_volatile;
17120 // alignment: u32
17121 ensure_field_index(result->type, "alignment", 3);
17122 fields[3].special = ConstValSpecialStatic;
17123 fields[3].type = ira->codegen->builtin_types.entry_u32;
17124 bigint_init_unsigned(&fields[3].data.x_bigint, attrs_type->data.pointer.alignment);
17125 // child: type
17126 ensure_field_index(result->type, "child", 4);
17127 fields[4].special = ConstValSpecialStatic;
17128 fields[4].type = ira->codegen->builtin_types.entry_type;
17129 fields[4].data.x_type = attrs_type->data.pointer.child_type;
17130
17131 return result;
17132 };
17133
1713417132 if (type_entry == ira->codegen->builtin_types.entry_global_error_set) {
1713517133 zig_panic("TODO implement @typeInfo for global error set");
1713617134 }
......@@ -17166,7 +17164,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1716617164 {
1716717165 result = create_const_vals(1);
1716817166 result->special = ConstValSpecialStatic;
17169 result->type = ir_type_info_get_type(ira, "Int");
17167 result->type = ir_type_info_get_type(ira, "Int", nullptr);
1717017168
1717117169 ConstExprValue *fields = create_const_vals(2);
1717217170 result->data.x_struct.fields = fields;
......@@ -17188,7 +17186,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1718817186 {
1718917187 result = create_const_vals(1);
1719017188 result->special = ConstValSpecialStatic;
17191 result->type = ir_type_info_get_type(ira, "Float");
17189 result->type = ir_type_info_get_type(ira, "Float", nullptr);
1719217190
1719317191 ConstExprValue *fields = create_const_vals(1);
1719417192 result->data.x_struct.fields = fields;
......@@ -17203,14 +17201,14 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1720317201 }
1720417202 case TypeTableEntryIdPointer:
1720517203 {
17206 result = create_ptr_like_type_info(type_entry);
17204 result = create_ptr_like_type_info(ira, type_entry);
1720717205 break;
1720817206 }
1720917207 case TypeTableEntryIdArray:
1721017208 {
1721117209 result = create_const_vals(1);
1721217210 result->special = ConstValSpecialStatic;
17213 result->type = ir_type_info_get_type(ira, "Array");
17211 result->type = ir_type_info_get_type(ira, "Array", nullptr);
1721417212
1721517213 ConstExprValue *fields = create_const_vals(2);
1721617214 result->data.x_struct.fields = fields;
......@@ -17232,7 +17230,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1723217230 {
1723317231 result = create_const_vals(1);
1723417232 result->special = ConstValSpecialStatic;
17235 result->type = ir_type_info_get_type(ira, "Optional");
17233 result->type = ir_type_info_get_type(ira, "Optional", nullptr);
1723617234
1723717235 ConstExprValue *fields = create_const_vals(1);
1723817236 result->data.x_struct.fields = fields;
......@@ -17249,7 +17247,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1724917247 {
1725017248 result = create_const_vals(1);
1725117249 result->special = ConstValSpecialStatic;
17252 result->type = ir_type_info_get_type(ira, "Promise");
17250 result->type = ir_type_info_get_type(ira, "Promise", nullptr);
1725317251
1725417252 ConstExprValue *fields = create_const_vals(1);
1725517253 result->data.x_struct.fields = fields;
......@@ -17275,7 +17273,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1727517273 {
1727617274 result = create_const_vals(1);
1727717275 result->special = ConstValSpecialStatic;
17278 result->type = ir_type_info_get_type(ira, "Enum");
17276 result->type = ir_type_info_get_type(ira, "Enum", nullptr);
1727917277
1728017278 ConstExprValue *fields = create_const_vals(4);
1728117279 result->data.x_struct.fields = fields;
......@@ -17283,7 +17281,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1728317281 // layout: ContainerLayout
1728417282 ensure_field_index(result->type, "layout", 0);
1728517283 fields[0].special = ConstValSpecialStatic;
17286 fields[0].type = ir_type_info_get_type(ira, "ContainerLayout");
17284 fields[0].type = ir_type_info_get_type(ira, "ContainerLayout", nullptr);
1728717285 bigint_init_unsigned(&fields[0].data.x_enum_tag, type_entry->data.enumeration.layout);
1728817286 // tag_type: type
1728917287 ensure_field_index(result->type, "tag_type", 1);
......@@ -17293,7 +17291,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1729317291 // fields: []TypeInfo.EnumField
1729417292 ensure_field_index(result->type, "fields", 2);
1729517293
17296 TypeTableEntry *type_info_enum_field_type = ir_type_info_get_type(ira, "EnumField");
17294 TypeTableEntry *type_info_enum_field_type = ir_type_info_get_type(ira, "EnumField", nullptr);
1729717295 uint32_t enum_field_count = type_entry->data.enumeration.src_field_count;
1729817296
1729917297 ConstExprValue *enum_field_array = create_const_vals(1);
......@@ -17325,7 +17323,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1732517323 {
1732617324 result = create_const_vals(1);
1732717325 result->special = ConstValSpecialStatic;
17328 result->type = ir_type_info_get_type(ira, "ErrorSet");
17326 result->type = ir_type_info_get_type(ira, "ErrorSet", nullptr);
1732917327
1733017328 ConstExprValue *fields = create_const_vals(1);
1733117329 result->data.x_struct.fields = fields;
......@@ -17333,7 +17331,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1733317331 // errors: []TypeInfo.Error
1733417332 ensure_field_index(result->type, "errors", 0);
1733517333
17336 TypeTableEntry *type_info_error_type = ir_type_info_get_type(ira, "Error");
17334 TypeTableEntry *type_info_error_type = ir_type_info_get_type(ira, "Error", nullptr);
1733717335 uint32_t error_count = type_entry->data.error_set.err_count;
1733817336 ConstExprValue *error_array = create_const_vals(1);
1733917337 error_array->special = ConstValSpecialStatic;
......@@ -17375,7 +17373,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1737517373 {
1737617374 result = create_const_vals(1);
1737717375 result->special = ConstValSpecialStatic;
17378 result->type = ir_type_info_get_type(ira, "ErrorUnion");
17376 result->type = ir_type_info_get_type(ira, "ErrorUnion", nullptr);
1737917377
1738017378 ConstExprValue *fields = create_const_vals(2);
1738117379 result->data.x_struct.fields = fields;
......@@ -17398,7 +17396,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1739817396 {
1739917397 result = create_const_vals(1);
1740017398 result->special = ConstValSpecialStatic;
17401 result->type = ir_type_info_get_type(ira, "Union");
17399 result->type = ir_type_info_get_type(ira, "Union", nullptr);
1740217400
1740317401 ConstExprValue *fields = create_const_vals(4);
1740417402 result->data.x_struct.fields = fields;
......@@ -17406,7 +17404,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1740617404 // layout: ContainerLayout
1740717405 ensure_field_index(result->type, "layout", 0);
1740817406 fields[0].special = ConstValSpecialStatic;
17409 fields[0].type = ir_type_info_get_type(ira, "ContainerLayout");
17407 fields[0].type = ir_type_info_get_type(ira, "ContainerLayout", nullptr);
1741017408 bigint_init_unsigned(&fields[0].data.x_enum_tag, type_entry->data.unionation.layout);
1741117409 // tag_type: ?type
1741217410 ensure_field_index(result->type, "tag_type", 1);
......@@ -17428,7 +17426,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1742817426 // fields: []TypeInfo.UnionField
1742917427 ensure_field_index(result->type, "fields", 2);
1743017428
17431 TypeTableEntry *type_info_union_field_type = ir_type_info_get_type(ira, "UnionField");
17429 TypeTableEntry *type_info_union_field_type = ir_type_info_get_type(ira, "UnionField", nullptr);
1743217430 uint32_t union_field_count = type_entry->data.unionation.src_field_count;
1743317431
1743417432 ConstExprValue *union_field_array = create_const_vals(1);
......@@ -17440,7 +17438,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1744017438
1744117439 init_const_slice(ira->codegen, &fields[2], union_field_array, 0, union_field_count, false);
1744217440
17443 TypeTableEntry *type_info_enum_field_type = ir_type_info_get_type(ira, "EnumField");
17441 TypeTableEntry *type_info_enum_field_type = ir_type_info_get_type(ira, "EnumField", nullptr);
1744417442
1744517443 for (uint32_t union_field_index = 0; union_field_index < union_field_count; union_field_index++) {
1744617444 TypeUnionField *union_field = &type_entry->data.unionation.fields[union_field_index];
......@@ -17482,13 +17480,13 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1748217480 case TypeTableEntryIdStruct:
1748317481 {
1748417482 if (type_entry->data.structure.is_slice) {
17485 result = create_ptr_like_type_info(type_entry);
17483 result = create_ptr_like_type_info(ira, type_entry);
1748617484 break;
1748717485 }
1748817486
1748917487 result = create_const_vals(1);
1749017488 result->special = ConstValSpecialStatic;
17491 result->type = ir_type_info_get_type(ira, "Struct");
17489 result->type = ir_type_info_get_type(ira, "Struct", nullptr);
1749217490
1749317491 ConstExprValue *fields = create_const_vals(3);
1749417492 result->data.x_struct.fields = fields;
......@@ -17496,12 +17494,12 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1749617494 // layout: ContainerLayout
1749717495 ensure_field_index(result->type, "layout", 0);
1749817496 fields[0].special = ConstValSpecialStatic;
17499 fields[0].type = ir_type_info_get_type(ira, "ContainerLayout");
17497 fields[0].type = ir_type_info_get_type(ira, "ContainerLayout", nullptr);
1750017498 bigint_init_unsigned(&fields[0].data.x_enum_tag, type_entry->data.structure.layout);
1750117499 // fields: []TypeInfo.StructField
1750217500 ensure_field_index(result->type, "fields", 1);
1750317501
17504 TypeTableEntry *type_info_struct_field_type = ir_type_info_get_type(ira, "StructField");
17502 TypeTableEntry *type_info_struct_field_type = ir_type_info_get_type(ira, "StructField", nullptr);
1750517503 uint32_t struct_field_count = type_entry->data.structure.src_field_count;
1750617504
1750717505 ConstExprValue *struct_field_array = create_const_vals(1);
......@@ -17557,7 +17555,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1755717555 {
1755817556 result = create_const_vals(1);
1755917557 result->special = ConstValSpecialStatic;
17560 result->type = ir_type_info_get_type(ira, "Fn");
17558 result->type = ir_type_info_get_type(ira, "Fn", nullptr);
1756117559
1756217560 ConstExprValue *fields = create_const_vals(6);
1756317561 result->data.x_struct.fields = fields;
......@@ -17565,7 +17563,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1756517563 // calling_convention: TypeInfo.CallingConvention
1756617564 ensure_field_index(result->type, "calling_convention", 0);
1756717565 fields[0].special = ConstValSpecialStatic;
17568 fields[0].type = ir_type_info_get_type(ira, "CallingConvention");
17566 fields[0].type = ir_type_info_get_type(ira, "CallingConvention", nullptr);
1756917567 bigint_init_unsigned(&fields[0].data.x_enum_tag, type_entry->data.fn.fn_type_id.cc);
1757017568 // is_generic: bool
1757117569 ensure_field_index(result->type, "is_generic", 1);
......@@ -17606,7 +17604,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1760617604 fields[4].data.x_optional = async_alloc_type;
1760717605 }
1760817606 // args: []TypeInfo.FnArg
17609 TypeTableEntry *type_info_fn_arg_type = ir_type_info_get_type(ira, "FnArg");
17607 TypeTableEntry *type_info_fn_arg_type = ir_type_info_get_type(ira, "FnArg", nullptr);
1761017608 size_t fn_arg_count = type_entry->data.fn.fn_type_id.param_count -
1761117609 (is_varargs && type_entry->data.fn.fn_type_id.cc != CallingConventionC);
1761217610
......@@ -17681,7 +17679,7 @@ static TypeTableEntry *ir_analyze_instruction_type_info(IrAnalyze *ira,
1768117679 if (type_is_invalid(type_entry))
1768217680 return ira->codegen->builtin_types.entry_invalid;
1768317681
17684 TypeTableEntry *result_type = ir_type_info_get_type(ira, nullptr);
17682 TypeTableEntry *result_type = ir_type_info_get_type(ira, nullptr, nullptr);
1768517683
1768617684 ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base);
1768717685 out_val->type = result_type;