| ... | @@ -18380,37 +18380,37 @@ static ZigType *ir_type_info_get_type(IrAnalyze *ira, const char *type_name, Zig | ... | @@ -18380,37 +18380,37 @@ static ZigType *ir_type_info_get_type(IrAnalyze *ira, const char *type_name, Zig |
| 18380 | return var->const_value->data.x_type; | 18380 | return var->const_value->data.x_type; |
| 18381 | } | 18381 | } |
| 18382 | | 18382 | |
| 18383 | static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, ConstExprValue *out_val, | 18383 | static Error ir_make_type_info_decls(IrAnalyze *ira, IrInstruction *source_instr, ConstExprValue *out_val, |
| 18384 | ScopeDecls *decls_scope) | 18384 | ScopeDecls *decls_scope) |
| 18385 | { | 18385 | { |
| 18386 | Error err; | 18386 | Error err; |
| 18387 | ZigType *type_info_definition_type = ir_type_info_get_type(ira, "Definition", nullptr); | 18387 | ZigType *type_info_declaration_type = ir_type_info_get_type(ira, "Declaration", nullptr); |
| 18388 | if ((err = type_resolve(ira->codegen, type_info_definition_type, ResolveStatusSizeKnown))) | 18388 | if ((err = type_resolve(ira->codegen, type_info_declaration_type, ResolveStatusSizeKnown))) |
| 18389 | return err; | 18389 | return err; |
| 18390 | | 18390 | |
| 18391 | ensure_field_index(type_info_definition_type, "name", 0); | 18391 | ensure_field_index(type_info_declaration_type, "name", 0); |
| 18392 | ensure_field_index(type_info_definition_type, "is_pub", 1); | 18392 | ensure_field_index(type_info_declaration_type, "is_pub", 1); |
| 18393 | ensure_field_index(type_info_definition_type, "data", 2); | 18393 | ensure_field_index(type_info_declaration_type, "data", 2); |
| 18394 | | 18394 | |
| 18395 | ZigType *type_info_definition_data_type = ir_type_info_get_type(ira, "Data", type_info_definition_type); | 18395 | ZigType *type_info_declaration_data_type = ir_type_info_get_type(ira, "Data", type_info_declaration_type); |
| 18396 | if ((err = ensure_complete_type(ira->codegen, type_info_definition_data_type))) | 18396 | if ((err = ensure_complete_type(ira->codegen, type_info_declaration_data_type))) |
| 18397 | return err; | 18397 | return err; |
| 18398 | | 18398 | |
| 18399 | ZigType *type_info_fn_def_type = ir_type_info_get_type(ira, "FnDef", type_info_definition_data_type); | 18399 | ZigType *type_info_fn_decl_type = ir_type_info_get_type(ira, "FnDecl", type_info_declaration_data_type); |
| 18400 | if ((err = ensure_complete_type(ira->codegen, type_info_fn_def_type))) | 18400 | if ((err = ensure_complete_type(ira->codegen, type_info_fn_decl_type))) |
| 18401 | return err; | 18401 | return err; |
| 18402 | | 18402 | |
| 18403 | ZigType *type_info_fn_def_inline_type = ir_type_info_get_type(ira, "Inline", type_info_fn_def_type); | 18403 | ZigType *type_info_fn_decl_inline_type = ir_type_info_get_type(ira, "Inline", type_info_fn_decl_type); |
| 18404 | if ((err = ensure_complete_type(ira->codegen, type_info_fn_def_inline_type))) | 18404 | if ((err = ensure_complete_type(ira->codegen, type_info_fn_decl_inline_type))) |
| 18405 | return err; | 18405 | return err; |
| 18406 | | 18406 | |
| 18407 | // Loop through our definitions once to figure out how many definitions we will generate info for. | 18407 | // Loop through our declarations once to figure out how many declarations we will generate info for. |
| 18408 | auto decl_it = decls_scope->decl_table.entry_iterator(); | 18408 | auto decl_it = decls_scope->decl_table.entry_iterator(); |
| 18409 | decltype(decls_scope->decl_table)::Entry *curr_entry = nullptr; | 18409 | decltype(decls_scope->decl_table)::Entry *curr_entry = nullptr; |
| 18410 | int definition_count = 0; | 18410 | int declaration_count = 0; |
| 18411 | | 18411 | |
| 18412 | while ((curr_entry = decl_it.next()) != nullptr) { | 18412 | while ((curr_entry = decl_it.next()) != nullptr) { |
| 18413 | // If the definition is unresolved, force it to be resolved again. | 18413 | // If the declaration is unresolved, force it to be resolved again. |
| 18414 | if (curr_entry->value->resolution == TldResolutionUnresolved) { | 18414 | if (curr_entry->value->resolution == TldResolutionUnresolved) { |
| 18415 | resolve_top_level_decl(ira->codegen, curr_entry->value, curr_entry->value->source_node); | 18415 | resolve_top_level_decl(ira->codegen, curr_entry->value, curr_entry->value->source_node); |
| 18416 | if (curr_entry->value->resolution != TldResolutionOk) { | 18416 | if (curr_entry->value->resolution != TldResolutionOk) { |
| ... | @@ -18426,21 +18426,21 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, | ... | @@ -18426,21 +18426,21 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, |
| 18426 | continue; | 18426 | continue; |
| 18427 | } | 18427 | } |
| 18428 | | 18428 | |
| 18429 | definition_count += 1; | 18429 | declaration_count += 1; |
| 18430 | } | 18430 | } |
| 18431 | } | 18431 | } |
| 18432 | | 18432 | |
| 18433 | ConstExprValue *definition_array = create_const_vals(1); | 18433 | ConstExprValue *declaration_array = create_const_vals(1); |
| 18434 | definition_array->special = ConstValSpecialStatic; | 18434 | declaration_array->special = ConstValSpecialStatic; |
| 18435 | definition_array->type = get_array_type(ira->codegen, type_info_definition_type, definition_count); | 18435 | declaration_array->type = get_array_type(ira->codegen, type_info_declaration_type, declaration_count); |
| 18436 | definition_array->data.x_array.special = ConstArraySpecialNone; | 18436 | declaration_array->data.x_array.special = ConstArraySpecialNone; |
| 18437 | definition_array->data.x_array.data.s_none.elements = create_const_vals(definition_count); | 18437 | declaration_array->data.x_array.data.s_none.elements = create_const_vals(declaration_count); |
| 18438 | init_const_slice(ira->codegen, out_val, definition_array, 0, definition_count, false); | 18438 | init_const_slice(ira->codegen, out_val, declaration_array, 0, declaration_count, false); |
| 18439 | | 18439 | |
| 18440 | // Loop through the definitions and generate info. | 18440 | // Loop through the declarations and generate info. |
| 18441 | decl_it = decls_scope->decl_table.entry_iterator(); | 18441 | decl_it = decls_scope->decl_table.entry_iterator(); |
| 18442 | curr_entry = nullptr; | 18442 | curr_entry = nullptr; |
| 18443 | int definition_index = 0; | 18443 | int declaration_index = 0; |
| 18444 | while ((curr_entry = decl_it.next()) != nullptr) { | 18444 | while ((curr_entry = decl_it.next()) != nullptr) { |
| 18445 | // Skip comptime blocks and test functions. | 18445 | // Skip comptime blocks and test functions. |
| 18446 | if (curr_entry->value->id == TldIdCompTime) { | 18446 | if (curr_entry->value->id == TldIdCompTime) { |
| ... | @@ -18451,10 +18451,10 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, | ... | @@ -18451,10 +18451,10 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, |
| 18451 | continue; | 18451 | continue; |
| 18452 | } | 18452 | } |
| 18453 | | 18453 | |
| 18454 | ConstExprValue *definition_val = &definition_array->data.x_array.data.s_none.elements[definition_index]; | 18454 | ConstExprValue *declaration_val = &declaration_array->data.x_array.data.s_none.elements[declaration_index]; |
| 18455 | | 18455 | |
| 18456 | definition_val->special = ConstValSpecialStatic; | 18456 | declaration_val->special = ConstValSpecialStatic; |
| 18457 | definition_val->type = type_info_definition_type; | 18457 | declaration_val->type = type_info_declaration_type; |
| 18458 | | 18458 | |
| 18459 | ConstExprValue *inner_fields = create_const_vals(3); | 18459 | ConstExprValue *inner_fields = create_const_vals(3); |
| 18460 | ConstExprValue *name = create_const_str_lit(ira->codegen, curr_entry->key); | 18460 | ConstExprValue *name = create_const_str_lit(ira->codegen, curr_entry->key); |
| ... | @@ -18463,9 +18463,9 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, | ... | @@ -18463,9 +18463,9 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, |
| 18463 | inner_fields[1].type = ira->codegen->builtin_types.entry_bool; | 18463 | inner_fields[1].type = ira->codegen->builtin_types.entry_bool; |
| 18464 | inner_fields[1].data.x_bool = curr_entry->value->visib_mod == VisibModPub; | 18464 | inner_fields[1].data.x_bool = curr_entry->value->visib_mod == VisibModPub; |
| 18465 | inner_fields[2].special = ConstValSpecialStatic; | 18465 | inner_fields[2].special = ConstValSpecialStatic; |
| 18466 | inner_fields[2].type = type_info_definition_data_type; | 18466 | inner_fields[2].type = type_info_declaration_data_type; |
| 18467 | inner_fields[2].parent.id = ConstParentIdStruct; | 18467 | inner_fields[2].parent.id = ConstParentIdStruct; |
| 18468 | inner_fields[2].parent.data.p_struct.struct_val = definition_val; | 18468 | inner_fields[2].parent.data.p_struct.struct_val = declaration_val; |
| 18469 | inner_fields[2].parent.data.p_struct.field_index = 1; | 18469 | inner_fields[2].parent.data.p_struct.field_index = 1; |
| 18470 | | 18470 | |
| 18471 | switch (curr_entry->value->id) { | 18471 | switch (curr_entry->value->id) { |
| ... | @@ -18476,7 +18476,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, | ... | @@ -18476,7 +18476,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, |
| 18476 | return ErrorSemanticAnalyzeFail; | 18476 | return ErrorSemanticAnalyzeFail; |
| 18477 | | 18477 | |
| 18478 | if (var->const_value->type->id == ZigTypeIdMetaType) { | 18478 | if (var->const_value->type->id == ZigTypeIdMetaType) { |
| 18479 | // We have a variable of type 'type', so it's actually a type definition. | 18479 | // We have a variable of type 'type', so it's actually a type declaration. |
| 18480 | // 0: Data.Type: type | 18480 | // 0: Data.Type: type |
| 18481 | bigint_init_unsigned(&inner_fields[2].data.x_union.tag, 0); | 18481 | bigint_init_unsigned(&inner_fields[2].data.x_union.tag, 0); |
| 18482 | inner_fields[2].data.x_union.payload = var->const_value; | 18482 | inner_fields[2].data.x_union.payload = var->const_value; |
| ... | @@ -18496,7 +18496,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, | ... | @@ -18496,7 +18496,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, |
| 18496 | } | 18496 | } |
| 18497 | case TldIdFn: | 18497 | case TldIdFn: |
| 18498 | { | 18498 | { |
| 18499 | // 2: Data.Fn: Data.FnDef | 18499 | // 2: Data.Fn: Data.FnDecl |
| 18500 | bigint_init_unsigned(&inner_fields[2].data.x_union.tag, 2); | 18500 | bigint_init_unsigned(&inner_fields[2].data.x_union.tag, 2); |
| 18501 | | 18501 | |
| 18502 | ZigFn *fn_entry = ((TldFn *)curr_entry->value)->fn_entry; | 18502 | ZigFn *fn_entry = ((TldFn *)curr_entry->value)->fn_entry; |
| ... | @@ -18509,68 +18509,68 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, | ... | @@ -18509,68 +18509,68 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, |
| 18509 | | 18509 | |
| 18510 | AstNodeFnProto *fn_node = &fn_entry->proto_node->data.fn_proto; | 18510 | AstNodeFnProto *fn_node = &fn_entry->proto_node->data.fn_proto; |
| 18511 | | 18511 | |
| 18512 | ConstExprValue *fn_def_val = create_const_vals(1); | 18512 | ConstExprValue *fn_decl_val = create_const_vals(1); |
| 18513 | fn_def_val->special = ConstValSpecialStatic; | 18513 | fn_decl_val->special = ConstValSpecialStatic; |
| 18514 | fn_def_val->type = type_info_fn_def_type; | 18514 | fn_decl_val->type = type_info_fn_decl_type; |
| 18515 | fn_def_val->parent.id = ConstParentIdUnion; | 18515 | fn_decl_val->parent.id = ConstParentIdUnion; |
| 18516 | fn_def_val->parent.data.p_union.union_val = &inner_fields[2]; | 18516 | fn_decl_val->parent.data.p_union.union_val = &inner_fields[2]; |
| 18517 | | 18517 | |
| 18518 | ConstExprValue *fn_def_fields = create_const_vals(9); | 18518 | ConstExprValue *fn_decl_fields = create_const_vals(9); |
| 18519 | fn_def_val->data.x_struct.fields = fn_def_fields; | 18519 | fn_decl_val->data.x_struct.fields = fn_decl_fields; |
| 18520 | | 18520 | |
| 18521 | // fn_type: type | 18521 | // fn_type: type |
| 18522 | ensure_field_index(fn_def_val->type, "fn_type", 0); | 18522 | ensure_field_index(fn_decl_val->type, "fn_type", 0); |
| 18523 | fn_def_fields[0].special = ConstValSpecialStatic; | 18523 | fn_decl_fields[0].special = ConstValSpecialStatic; |
| 18524 | fn_def_fields[0].type = ira->codegen->builtin_types.entry_type; | 18524 | fn_decl_fields[0].type = ira->codegen->builtin_types.entry_type; |
| 18525 | fn_def_fields[0].data.x_type = fn_entry->type_entry; | 18525 | fn_decl_fields[0].data.x_type = fn_entry->type_entry; |
| 18526 | // inline_type: Data.FnDef.Inline | 18526 | // inline_type: Data.FnDecl.Inline |
| 18527 | ensure_field_index(fn_def_val->type, "inline_type", 1); | 18527 | ensure_field_index(fn_decl_val->type, "inline_type", 1); |
| 18528 | fn_def_fields[1].special = ConstValSpecialStatic; | 18528 | fn_decl_fields[1].special = ConstValSpecialStatic; |
| 18529 | fn_def_fields[1].type = type_info_fn_def_inline_type; | 18529 | fn_decl_fields[1].type = type_info_fn_decl_inline_type; |
| 18530 | bigint_init_unsigned(&fn_def_fields[1].data.x_enum_tag, fn_entry->fn_inline); | 18530 | bigint_init_unsigned(&fn_decl_fields[1].data.x_enum_tag, fn_entry->fn_inline); |
| 18531 | // calling_convention: TypeInfo.CallingConvention | 18531 | // calling_convention: TypeInfo.CallingConvention |
| 18532 | ensure_field_index(fn_def_val->type, "calling_convention", 2); | 18532 | ensure_field_index(fn_decl_val->type, "calling_convention", 2); |
| 18533 | fn_def_fields[2].special = ConstValSpecialStatic; | 18533 | fn_decl_fields[2].special = ConstValSpecialStatic; |
| 18534 | fn_def_fields[2].type = ir_type_info_get_type(ira, "CallingConvention", nullptr); | 18534 | fn_decl_fields[2].type = ir_type_info_get_type(ira, "CallingConvention", nullptr); |
| 18535 | bigint_init_unsigned(&fn_def_fields[2].data.x_enum_tag, fn_node->cc); | 18535 | bigint_init_unsigned(&fn_decl_fields[2].data.x_enum_tag, fn_node->cc); |
| 18536 | // is_var_args: bool | 18536 | // is_var_args: bool |
| 18537 | ensure_field_index(fn_def_val->type, "is_var_args", 3); | 18537 | ensure_field_index(fn_decl_val->type, "is_var_args", 3); |
| 18538 | bool is_varargs = fn_node->is_var_args; | 18538 | bool is_varargs = fn_node->is_var_args; |
| 18539 | fn_def_fields[3].special = ConstValSpecialStatic; | 18539 | fn_decl_fields[3].special = ConstValSpecialStatic; |
| 18540 | fn_def_fields[3].type = ira->codegen->builtin_types.entry_bool; | 18540 | fn_decl_fields[3].type = ira->codegen->builtin_types.entry_bool; |
| 18541 | fn_def_fields[3].data.x_bool = is_varargs; | 18541 | fn_decl_fields[3].data.x_bool = is_varargs; |
| 18542 | // is_extern: bool | 18542 | // is_extern: bool |
| 18543 | ensure_field_index(fn_def_val->type, "is_extern", 4); | 18543 | ensure_field_index(fn_decl_val->type, "is_extern", 4); |
| 18544 | fn_def_fields[4].special = ConstValSpecialStatic; | 18544 | fn_decl_fields[4].special = ConstValSpecialStatic; |
| 18545 | fn_def_fields[4].type = ira->codegen->builtin_types.entry_bool; | 18545 | fn_decl_fields[4].type = ira->codegen->builtin_types.entry_bool; |
| 18546 | fn_def_fields[4].data.x_bool = fn_node->is_extern; | 18546 | fn_decl_fields[4].data.x_bool = fn_node->is_extern; |
| 18547 | // is_export: bool | 18547 | // is_export: bool |
| 18548 | ensure_field_index(fn_def_val->type, "is_export", 5); | 18548 | ensure_field_index(fn_decl_val->type, "is_export", 5); |
| 18549 | fn_def_fields[5].special = ConstValSpecialStatic; | 18549 | fn_decl_fields[5].special = ConstValSpecialStatic; |
| 18550 | fn_def_fields[5].type = ira->codegen->builtin_types.entry_bool; | 18550 | fn_decl_fields[5].type = ira->codegen->builtin_types.entry_bool; |
| 18551 | fn_def_fields[5].data.x_bool = fn_node->is_export; | 18551 | fn_decl_fields[5].data.x_bool = fn_node->is_export; |
| 18552 | // lib_name: ?[]const u8 | 18552 | // lib_name: ?[]const u8 |
| 18553 | ensure_field_index(fn_def_val->type, "lib_name", 6); | 18553 | ensure_field_index(fn_decl_val->type, "lib_name", 6); |
| 18554 | fn_def_fields[6].special = ConstValSpecialStatic; | 18554 | fn_decl_fields[6].special = ConstValSpecialStatic; |
| 18555 | ZigType *u8_ptr = get_pointer_to_type_extra( | 18555 | ZigType *u8_ptr = get_pointer_to_type_extra( |
| 18556 | ira->codegen, ira->codegen->builtin_types.entry_u8, | 18556 | ira->codegen, ira->codegen->builtin_types.entry_u8, |
| 18557 | true, false, PtrLenUnknown, | 18557 | true, false, PtrLenUnknown, |
| 18558 | 0, 0, 0, false); | 18558 | 0, 0, 0, false); |
| 18559 | fn_def_fields[6].type = get_optional_type(ira->codegen, get_slice_type(ira->codegen, u8_ptr)); | 18559 | fn_decl_fields[6].type = get_optional_type(ira->codegen, get_slice_type(ira->codegen, u8_ptr)); |
| 18560 | if (fn_node->is_extern && buf_len(fn_node->lib_name) > 0) { | 18560 | if (fn_node->is_extern && buf_len(fn_node->lib_name) > 0) { |
| 18561 | fn_def_fields[6].data.x_optional = create_const_vals(1); | 18561 | fn_decl_fields[6].data.x_optional = create_const_vals(1); |
| 18562 | ConstExprValue *lib_name = create_const_str_lit(ira->codegen, fn_node->lib_name); | 18562 | ConstExprValue *lib_name = create_const_str_lit(ira->codegen, fn_node->lib_name); |
| 18563 | init_const_slice(ira->codegen, fn_def_fields[6].data.x_optional, lib_name, 0, buf_len(fn_node->lib_name), true); | 18563 | init_const_slice(ira->codegen, fn_decl_fields[6].data.x_optional, lib_name, 0, buf_len(fn_node->lib_name), true); |
| 18564 | } else { | 18564 | } else { |
| 18565 | fn_def_fields[6].data.x_optional = nullptr; | 18565 | fn_decl_fields[6].data.x_optional = nullptr; |
| 18566 | } | 18566 | } |
| 18567 | // return_type: type | 18567 | // return_type: type |
| 18568 | ensure_field_index(fn_def_val->type, "return_type", 7); | 18568 | ensure_field_index(fn_decl_val->type, "return_type", 7); |
| 18569 | fn_def_fields[7].special = ConstValSpecialStatic; | 18569 | fn_decl_fields[7].special = ConstValSpecialStatic; |
| 18570 | fn_def_fields[7].type = ira->codegen->builtin_types.entry_type; | 18570 | fn_decl_fields[7].type = ira->codegen->builtin_types.entry_type; |
| 18571 | fn_def_fields[7].data.x_type = fn_entry->type_entry->data.fn.fn_type_id.return_type; | 18571 | fn_decl_fields[7].data.x_type = fn_entry->type_entry->data.fn.fn_type_id.return_type; |
| 18572 | // arg_names: [][] const u8 | 18572 | // arg_names: [][] const u8 |
| 18573 | ensure_field_index(fn_def_val->type, "arg_names", 8); | 18573 | ensure_field_index(fn_decl_val->type, "arg_names", 8); |
| 18574 | size_t fn_arg_count = fn_entry->variable_list.length; | 18574 | size_t fn_arg_count = fn_entry->variable_list.length; |
| 18575 | ConstExprValue *fn_arg_name_array = create_const_vals(1); | 18575 | ConstExprValue *fn_arg_name_array = create_const_vals(1); |
| 18576 | fn_arg_name_array->special = ConstValSpecialStatic; | 18576 | fn_arg_name_array->special = ConstValSpecialStatic; |
| ... | @@ -18579,7 +18579,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, | ... | @@ -18579,7 +18579,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, |
| 18579 | fn_arg_name_array->data.x_array.special = ConstArraySpecialNone; | 18579 | fn_arg_name_array->data.x_array.special = ConstArraySpecialNone; |
| 18580 | fn_arg_name_array->data.x_array.data.s_none.elements = create_const_vals(fn_arg_count); | 18580 | fn_arg_name_array->data.x_array.data.s_none.elements = create_const_vals(fn_arg_count); |
| 18581 | | 18581 | |
| 18582 | init_const_slice(ira->codegen, &fn_def_fields[8], fn_arg_name_array, 0, fn_arg_count, false); | 18582 | init_const_slice(ira->codegen, &fn_decl_fields[8], fn_arg_name_array, 0, fn_arg_count, false); |
| 18583 | | 18583 | |
| 18584 | for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) { | 18584 | for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) { |
| 18585 | ZigVar *arg_var = fn_entry->variable_list.at(fn_arg_index); | 18585 | ZigVar *arg_var = fn_entry->variable_list.at(fn_arg_index); |
| ... | @@ -18591,7 +18591,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, | ... | @@ -18591,7 +18591,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, |
| 18591 | fn_arg_name_val->parent.data.p_array.elem_index = fn_arg_index; | 18591 | fn_arg_name_val->parent.data.p_array.elem_index = fn_arg_index; |
| 18592 | } | 18592 | } |
| 18593 | | 18593 | |
| 18594 | inner_fields[2].data.x_union.payload = fn_def_val; | 18594 | inner_fields[2].data.x_union.payload = fn_decl_val; |
| 18595 | break; | 18595 | break; |
| 18596 | } | 18596 | } |
| 18597 | case TldIdContainer: | 18597 | case TldIdContainer: |
| ... | @@ -18615,11 +18615,11 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, | ... | @@ -18615,11 +18615,11 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, |
| 18615 | zig_unreachable(); | 18615 | zig_unreachable(); |
| 18616 | } | 18616 | } |
| 18617 | | 18617 | |
| 18618 | definition_val->data.x_struct.fields = inner_fields; | 18618 | declaration_val->data.x_struct.fields = inner_fields; |
| 18619 | definition_index++; | 18619 | declaration_index++; |
| 18620 | } | 18620 | } |
| 18621 | | 18621 | |
| 18622 | assert(definition_index == definition_count); | 18622 | assert(declaration_index == declaration_count); |
| 18623 | return ErrorNone; | 18623 | return ErrorNone; |
| 18624 | } | 18624 | } |
| 18625 | | 18625 | |
| ... | @@ -18927,9 +18927,9 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInstruction *source_instr | ... | @@ -18927,9 +18927,9 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInstruction *source_instr |
| 18927 | enum_field_val->parent.data.p_array.array_val = enum_field_array; | 18927 | enum_field_val->parent.data.p_array.array_val = enum_field_array; |
| 18928 | enum_field_val->parent.data.p_array.elem_index = enum_field_index; | 18928 | enum_field_val->parent.data.p_array.elem_index = enum_field_index; |
| 18929 | } | 18929 | } |
| 18930 | // defs: []TypeInfo.Definition | 18930 | // decls: []TypeInfo.Declaration |
| 18931 | ensure_field_index(result->type, "defs", 3); | 18931 | ensure_field_index(result->type, "decls", 3); |
| 18932 | if ((err = ir_make_type_info_defs(ira, source_instr, &fields[3], | 18932 | if ((err = ir_make_type_info_decls(ira, source_instr, &fields[3], |
| 18933 | type_entry->data.enumeration.decls_scope))) | 18933 | type_entry->data.enumeration.decls_scope))) |
| 18934 | { | 18934 | { |
| 18935 | return err; | 18935 | return err; |
| ... | @@ -19094,9 +19094,9 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInstruction *source_instr | ... | @@ -19094,9 +19094,9 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInstruction *source_instr |
| 19094 | union_field_val->parent.data.p_array.array_val = union_field_array; | 19094 | union_field_val->parent.data.p_array.array_val = union_field_array; |
| 19095 | union_field_val->parent.data.p_array.elem_index = union_field_index; | 19095 | union_field_val->parent.data.p_array.elem_index = union_field_index; |
| 19096 | } | 19096 | } |
| 19097 | // defs: []TypeInfo.Definition | 19097 | // decls: []TypeInfo.Declaration |
| 19098 | ensure_field_index(result->type, "defs", 3); | 19098 | ensure_field_index(result->type, "decls", 3); |
| 19099 | if ((err = ir_make_type_info_defs(ira, source_instr, &fields[3], | 19099 | if ((err = ir_make_type_info_decls(ira, source_instr, &fields[3], |
| 19100 | type_entry->data.unionation.decls_scope))) | 19100 | type_entry->data.unionation.decls_scope))) |
| 19101 | { | 19101 | { |
| 19102 | return err; | 19102 | return err; |
| ... | @@ -19175,9 +19175,9 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInstruction *source_instr | ... | @@ -19175,9 +19175,9 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInstruction *source_instr |
| 19175 | struct_field_val->parent.data.p_array.array_val = struct_field_array; | 19175 | struct_field_val->parent.data.p_array.array_val = struct_field_array; |
| 19176 | struct_field_val->parent.data.p_array.elem_index = struct_field_index; | 19176 | struct_field_val->parent.data.p_array.elem_index = struct_field_index; |
| 19177 | } | 19177 | } |
| 19178 | // defs: []TypeInfo.Definition | 19178 | // decls: []TypeInfo.Declaration |
| 19179 | ensure_field_index(result->type, "defs", 2); | 19179 | ensure_field_index(result->type, "decls", 2); |
| 19180 | if ((err = ir_make_type_info_defs(ira, source_instr, &fields[2], | 19180 | if ((err = ir_make_type_info_decls(ira, source_instr, &fields[2], |
| 19181 | type_entry->data.structure.decls_scope))) | 19181 | type_entry->data.structure.decls_scope))) |
| 19182 | { | 19182 | { |
| 19183 | return err; | 19183 | return err; |