| ... | ... | @@ -25564,7 +25564,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy |
| 25564 | 25564 | result->special = ConstValSpecialStatic; |
| 25565 | 25565 | result->type = ir_type_info_get_type(ira, "Fn", nullptr); |
| 25566 | 25566 | |
| 25567 | | ZigValue **fields = alloc_const_vals_ptrs(ira->codegen, 5); |
| 25567 | ZigValue **fields = alloc_const_vals_ptrs(ira->codegen, 6); |
| 25568 | 25568 | result->data.x_struct.fields = fields; |
| 25569 | 25569 | |
| 25570 | 25570 | // calling_convention: TypeInfo.CallingConvention |
| ... | ... | @@ -25572,30 +25572,35 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy |
| 25572 | 25572 | fields[0]->special = ConstValSpecialStatic; |
| 25573 | 25573 | fields[0]->type = get_builtin_type(ira->codegen, "CallingConvention"); |
| 25574 | 25574 | bigint_init_unsigned(&fields[0]->data.x_enum_tag, type_entry->data.fn.fn_type_id.cc); |
| 25575 | // alignment: u29 |
| 25576 | ensure_field_index(result->type, "alignment", 1); |
| 25577 | fields[1]->special = ConstValSpecialStatic; |
| 25578 | fields[1]->type = ira->codegen->builtin_types.entry_u29; |
| 25579 | bigint_init_unsigned(&fields[1]->data.x_bigint, type_entry->data.fn.fn_type_id.alignment); |
| 25575 | 25580 | // is_generic: bool |
| 25576 | | ensure_field_index(result->type, "is_generic", 1); |
| 25581 | ensure_field_index(result->type, "is_generic", 2); |
| 25577 | 25582 | bool is_generic = type_entry->data.fn.is_generic; |
| 25578 | | fields[1]->special = ConstValSpecialStatic; |
| 25579 | | fields[1]->type = ira->codegen->builtin_types.entry_bool; |
| 25580 | | fields[1]->data.x_bool = is_generic; |
| 25581 | | // is_varargs: bool |
| 25582 | | ensure_field_index(result->type, "is_var_args", 2); |
| 25583 | | bool is_varargs = type_entry->data.fn.fn_type_id.is_var_args; |
| 25584 | 25583 | fields[2]->special = ConstValSpecialStatic; |
| 25585 | 25584 | fields[2]->type = ira->codegen->builtin_types.entry_bool; |
| 25586 | | fields[2]->data.x_bool = type_entry->data.fn.fn_type_id.is_var_args; |
| 25587 | | // return_type: ?type |
| 25588 | | ensure_field_index(result->type, "return_type", 3); |
| 25585 | fields[2]->data.x_bool = is_generic; |
| 25586 | // is_varargs: bool |
| 25587 | ensure_field_index(result->type, "is_var_args", 3); |
| 25588 | bool is_varargs = type_entry->data.fn.fn_type_id.is_var_args; |
| 25589 | 25589 | fields[3]->special = ConstValSpecialStatic; |
| 25590 | | fields[3]->type = get_optional_type(ira->codegen, ira->codegen->builtin_types.entry_type); |
| 25590 | fields[3]->type = ira->codegen->builtin_types.entry_bool; |
| 25591 | fields[3]->data.x_bool = is_varargs; |
| 25592 | // return_type: ?type |
| 25593 | ensure_field_index(result->type, "return_type", 4); |
| 25594 | fields[4]->special = ConstValSpecialStatic; |
| 25595 | fields[4]->type = get_optional_type(ira->codegen, ira->codegen->builtin_types.entry_type); |
| 25591 | 25596 | if (type_entry->data.fn.fn_type_id.return_type == nullptr) |
| 25592 | | fields[3]->data.x_optional = nullptr; |
| 25597 | fields[4]->data.x_optional = nullptr; |
| 25593 | 25598 | else { |
| 25594 | 25599 | ZigValue *return_type = ira->codegen->pass1_arena->create<ZigValue>(); |
| 25595 | 25600 | return_type->special = ConstValSpecialStatic; |
| 25596 | 25601 | return_type->type = ira->codegen->builtin_types.entry_type; |
| 25597 | 25602 | return_type->data.x_type = type_entry->data.fn.fn_type_id.return_type; |
| 25598 | | fields[3]->data.x_optional = return_type; |
| 25603 | fields[4]->data.x_optional = return_type; |
| 25599 | 25604 | } |
| 25600 | 25605 | // args: []TypeInfo.FnArg |
| 25601 | 25606 | ZigType *type_info_fn_arg_type = ir_type_info_get_type(ira, "FnArg", nullptr); |
| ... | ... | @@ -25611,7 +25616,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy |
| 25611 | 25616 | fn_arg_array->data.x_array.special = ConstArraySpecialNone; |
| 25612 | 25617 | fn_arg_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(fn_arg_count); |
| 25613 | 25618 | |
| 25614 | | init_const_slice(ira->codegen, fields[4], fn_arg_array, 0, fn_arg_count, false); |
| 25619 | init_const_slice(ira->codegen, fields[5], fn_arg_array, 0, fn_arg_count, false); |
| 25615 | 25620 | |
| 25616 | 25621 | for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) { |
| 25617 | 25622 | FnTypeParamInfo *fn_param_info = &type_entry->data.fn.fn_type_id.param_info[fn_arg_index]; |