| ... | ... | @@ -1066,7 +1066,7 @@ static IrInstruction *ir_build_union_field_ptr_from(IrBuilder *irb, IrInstructio |
| 1066 | 1066 | |
| 1067 | 1067 | static IrInstruction *ir_build_call(IrBuilder *irb, Scope *scope, AstNode *source_node, |
| 1068 | 1068 | FnTableEntry *fn_entry, IrInstruction *fn_ref, size_t arg_count, IrInstruction **args, |
| 1069 | | bool is_comptime, FnInline fn_inline, bool is_async, IrInstruction *async_allocator) |
| 1069 | bool is_comptime, FnInline fn_inline, bool is_async, IrInstruction *async_allocator, IrInstruction *alloc_fn, IrInstruction *free_fn) |
| 1070 | 1070 | { |
| 1071 | 1071 | IrInstructionCall *call_instruction = ir_build_instruction<IrInstructionCall>(irb, scope, source_node); |
| 1072 | 1072 | call_instruction->fn_entry = fn_entry; |
| ... | ... | @@ -1077,6 +1077,8 @@ static IrInstruction *ir_build_call(IrBuilder *irb, Scope *scope, AstNode *sourc |
| 1077 | 1077 | call_instruction->arg_count = arg_count; |
| 1078 | 1078 | call_instruction->is_async = is_async; |
| 1079 | 1079 | call_instruction->async_allocator = async_allocator; |
| 1080 | call_instruction->alloc_fn = alloc_fn; |
| 1081 | call_instruction->free_fn = free_fn; |
| 1080 | 1082 | |
| 1081 | 1083 | if (fn_ref) |
| 1082 | 1084 | ir_ref_instruction(fn_ref, irb->current_basic_block); |
| ... | ... | @@ -1084,16 +1086,20 @@ static IrInstruction *ir_build_call(IrBuilder *irb, Scope *scope, AstNode *sourc |
| 1084 | 1086 | ir_ref_instruction(args[i], irb->current_basic_block); |
| 1085 | 1087 | if (async_allocator) |
| 1086 | 1088 | ir_ref_instruction(async_allocator, irb->current_basic_block); |
| 1089 | if (alloc_fn) |
| 1090 | ir_ref_instruction(alloc_fn, irb->current_basic_block); |
| 1091 | if (free_fn) |
| 1092 | ir_ref_instruction(free_fn, irb->current_basic_block); |
| 1087 | 1093 | |
| 1088 | 1094 | return &call_instruction->base; |
| 1089 | 1095 | } |
| 1090 | 1096 | |
| 1091 | 1097 | static IrInstruction *ir_build_call_from(IrBuilder *irb, IrInstruction *old_instruction, |
| 1092 | 1098 | FnTableEntry *fn_entry, IrInstruction *fn_ref, size_t arg_count, IrInstruction **args, |
| 1093 | | bool is_comptime, FnInline fn_inline, bool is_async, IrInstruction *async_allocator) |
| 1099 | bool is_comptime, FnInline fn_inline, bool is_async, IrInstruction *async_allocator, IrInstruction *alloc_fn, IrInstruction *free_fn) |
| 1094 | 1100 | { |
| 1095 | 1101 | IrInstruction *new_instruction = ir_build_call(irb, old_instruction->scope, |
| 1096 | | old_instruction->source_node, fn_entry, fn_ref, arg_count, args, is_comptime, fn_inline, is_async, async_allocator); |
| 1102 | old_instruction->source_node, fn_entry, fn_ref, arg_count, args, is_comptime, fn_inline, is_async, async_allocator, alloc_fn, free_fn); |
| 1097 | 1103 | ir_link_new_instruction(new_instruction, old_instruction); |
| 1098 | 1104 | return new_instruction; |
| 1099 | 1105 | } |
| ... | ... | @@ -2495,8 +2501,9 @@ static IrInstruction *ir_build_cancel(IrBuilder *irb, Scope *scope, AstNode *sou |
| 2495 | 2501 | return &instruction->base; |
| 2496 | 2502 | } |
| 2497 | 2503 | |
| 2498 | | static IrInstruction *ir_build_get_implicit_allocator(IrBuilder *irb, Scope *scope, AstNode *source_node) { |
| 2504 | static IrInstruction *ir_build_get_implicit_allocator(IrBuilder *irb, Scope *scope, AstNode *source_node, ImplicitAllocatorId id) { |
| 2499 | 2505 | IrInstructionGetImplicitAllocator *instruction = ir_build_instruction<IrInstructionGetImplicitAllocator>(irb, scope, source_node); |
| 2506 | instruction->id = id; |
| 2500 | 2507 | |
| 2501 | 2508 | return &instruction->base; |
| 2502 | 2509 | } |
| ... | ... | @@ -3970,7 +3977,7 @@ static IrInstruction *ir_gen_builtin_fn_call(IrBuilder *irb, Scope *scope, AstNo |
| 3970 | 3977 | } |
| 3971 | 3978 | FnInline fn_inline = (builtin_fn->id == BuiltinFnIdInlineCall) ? FnInlineAlways : FnInlineNever; |
| 3972 | 3979 | |
| 3973 | | return ir_build_call(irb, scope, node, nullptr, fn_ref, arg_count, args, false, fn_inline, false, nullptr); |
| 3980 | return ir_build_call(irb, scope, node, nullptr, fn_ref, arg_count, args, false, fn_inline, false, nullptr, nullptr, nullptr); |
| 3974 | 3981 | } |
| 3975 | 3982 | case BuiltinFnIdTypeId: |
| 3976 | 3983 | { |
| ... | ... | @@ -4106,15 +4113,25 @@ static IrInstruction *ir_gen_fn_call(IrBuilder *irb, Scope *scope, AstNode *node |
| 4106 | 4113 | |
| 4107 | 4114 | bool is_async = node->data.fn_call_expr.is_async; |
| 4108 | 4115 | IrInstruction *async_allocator = nullptr; |
| 4116 | IrInstruction *alloc_fn = nullptr; |
| 4117 | IrInstruction *free_fn = nullptr; |
| 4109 | 4118 | if (is_async) { |
| 4110 | 4119 | if (node->data.fn_call_expr.async_allocator) { |
| 4111 | 4120 | async_allocator = ir_gen_node(irb, node->data.fn_call_expr.async_allocator, scope); |
| 4112 | 4121 | if (async_allocator == irb->codegen->invalid_instruction) |
| 4113 | 4122 | return async_allocator; |
| 4123 | |
| 4124 | Buf *alloc_field_name = buf_create_from_str(ASYNC_ALLOC_FIELD_NAME); |
| 4125 | IrInstruction *alloc_fn_ptr = ir_build_field_ptr(irb, scope, node, async_allocator, alloc_field_name); |
| 4126 | alloc_fn = ir_build_load_ptr(irb, scope, node, alloc_fn_ptr); |
| 4127 | |
| 4128 | Buf *free_field_name = buf_create_from_str(ASYNC_FREE_FIELD_NAME); |
| 4129 | IrInstruction *free_fn_ptr = ir_build_field_ptr(irb, scope, node, async_allocator, free_field_name); |
| 4130 | free_fn = ir_build_load_ptr(irb, scope, node, free_fn_ptr); |
| 4114 | 4131 | } |
| 4115 | 4132 | } |
| 4116 | 4133 | |
| 4117 | | return ir_build_call(irb, scope, node, nullptr, fn_ref, arg_count, args, false, FnInlineAuto, is_async, async_allocator); |
| 4134 | return ir_build_call(irb, scope, node, nullptr, fn_ref, arg_count, args, false, FnInlineAuto, is_async, async_allocator, alloc_fn, free_fn); |
| 4118 | 4135 | } |
| 4119 | 4136 | |
| 4120 | 4137 | static IrInstruction *ir_gen_if_bool_expr(IrBuilder *irb, Scope *scope, AstNode *node) { |
| ... | ... | @@ -6106,20 +6123,16 @@ bool ir_gen(CodeGen *codegen, AstNode *node, Scope *scope, IrExecutable *ir_exec |
| 6106 | 6123 | |
| 6107 | 6124 | ir_set_cursor_at_end_and_append_block(irb, dyn_alloc_block); |
| 6108 | 6125 | IrInstruction *coro_size = ir_build_coro_size(irb, scope, node); |
| 6109 | | irb->exec->implicit_allocator_ptr = ir_build_get_implicit_allocator(irb, scope, node); |
| 6110 | | Buf *alloc_field_name = buf_create_from_str(ASYNC_ALLOC_FIELD_NAME); |
| 6111 | | IrInstruction *alloc_fn_ptr = ir_build_field_ptr(irb, scope, node, irb->exec->implicit_allocator_ptr, |
| 6112 | | alloc_field_name); |
| 6113 | | IrInstruction *alloc_fn = ir_build_load_ptr(irb, scope, node, alloc_fn_ptr); |
| 6114 | | IrInstruction *alignment = ir_build_const_u29(irb, scope, node, |
| 6115 | | get_coro_frame_align_bytes(irb->codegen)); |
| 6126 | irb->exec->implicit_allocator_ptr = ir_build_get_implicit_allocator(irb, scope, node, ImplicitAllocatorIdContext); |
| 6127 | IrInstruction *alloc_fn = ir_build_get_implicit_allocator(irb, scope, node, ImplicitAllocatorIdAlloc); |
| 6128 | IrInstruction *alignment = ir_build_const_u29(irb, scope, node, get_coro_frame_align_bytes(irb->codegen)); |
| 6116 | 6129 | size_t arg_count = 3; |
| 6117 | 6130 | IrInstruction **args = allocate<IrInstruction *>(arg_count); |
| 6118 | 6131 | args[0] = irb->exec->implicit_allocator_ptr; // self |
| 6119 | 6132 | args[1] = coro_size; // byte_count |
| 6120 | 6133 | args[2] = alignment; // alignment |
| 6121 | 6134 | IrInstruction *alloc_result = ir_build_call(irb, scope, node, nullptr, alloc_fn, arg_count, args, false, |
| 6122 | | FnInlineAuto, false, nullptr); |
| 6135 | FnInlineAuto, false, nullptr, nullptr, nullptr); |
| 6123 | 6136 | IrInstruction *alloc_result_ptr = ir_build_ref(irb, scope, node, alloc_result, true, false); |
| 6124 | 6137 | IrInstruction *alloc_result_is_err = ir_build_test_err(irb, scope, node, alloc_result); |
| 6125 | 6138 | IrBasicBlock *alloc_err_block = ir_create_basic_block(irb, scope, "AllocError"); |
| ... | ... | @@ -6237,15 +6250,12 @@ bool ir_gen(CodeGen *codegen, AstNode *node, Scope *scope, IrExecutable *ir_exec |
| 6237 | 6250 | ir_build_cond_br(irb, scope, node, coro_need_dyn_alloc, dyn_free_block, end_free_block, const_bool_false); |
| 6238 | 6251 | |
| 6239 | 6252 | ir_set_cursor_at_end_and_append_block(irb, dyn_free_block); |
| 6240 | | Buf *free_field_name = buf_create_from_str(ASYNC_FREE_FIELD_NAME); |
| 6241 | | IrInstruction *free_fn_ptr = ir_build_field_ptr(irb, scope, node, irb->exec->implicit_allocator_ptr, |
| 6242 | | free_field_name); |
| 6243 | | IrInstruction *free_fn = ir_build_load_ptr(irb, scope, node, free_fn_ptr); |
| 6253 | IrInstruction *free_fn = ir_build_get_implicit_allocator(irb, scope, node, ImplicitAllocatorIdFree); |
| 6244 | 6254 | size_t arg_count = 2; |
| 6245 | 6255 | IrInstruction **args = allocate<IrInstruction *>(arg_count); |
| 6246 | 6256 | args[0] = irb->exec->implicit_allocator_ptr; // self |
| 6247 | 6257 | args[1] = ir_build_load_ptr(irb, scope, node, coro_unwrapped_mem_ptr); // old_mem |
| 6248 | | ir_build_call(irb, scope, node, nullptr, free_fn, arg_count, args, false, FnInlineAuto, false, nullptr); |
| 6258 | ir_build_call(irb, scope, node, nullptr, free_fn, arg_count, args, false, FnInlineAuto, false, nullptr, nullptr, nullptr); |
| 6249 | 6259 | ir_build_br(irb, scope, node, end_free_block, const_bool_false); |
| 6250 | 6260 | |
| 6251 | 6261 | ir_set_cursor_at_end_and_append_block(irb, end_free_block); |
| ... | ... | @@ -11266,7 +11276,7 @@ static TypeTableEntry *ir_analyze_instruction_error_union(IrAnalyze *ira, |
| 11266 | 11276 | return ira->codegen->builtin_types.entry_type; |
| 11267 | 11277 | } |
| 11268 | 11278 | |
| 11269 | | IrInstruction *ir_get_implicit_allocator(IrAnalyze *ira, IrInstruction *source_instr) { |
| 11279 | IrInstruction *ir_get_implicit_allocator(IrAnalyze *ira, IrInstruction *source_instr, ImplicitAllocatorId id) { |
| 11270 | 11280 | FnTableEntry *parent_fn_entry = exec_fn_entry(ira->new_irb.exec); |
| 11271 | 11281 | if (parent_fn_entry == nullptr) { |
| 11272 | 11282 | ir_add_error(ira, source_instr, buf_sprintf("no implicit allocator available")); |
| ... | ... | @@ -11280,27 +11290,39 @@ IrInstruction *ir_get_implicit_allocator(IrAnalyze *ira, IrInstruction *source_i |
| 11280 | 11290 | } |
| 11281 | 11291 | |
| 11282 | 11292 | assert(parent_fn_type->async_allocator_type != nullptr); |
| 11283 | | IrInstruction *result = ir_build_get_implicit_allocator(&ira->new_irb, source_instr->scope, source_instr->source_node); |
| 11284 | | result->value.type = parent_fn_type->async_allocator_type; |
| 11293 | IrInstruction *result = ir_build_get_implicit_allocator(&ira->new_irb, source_instr->scope, source_instr->source_node, id); |
| 11294 | switch (id) { |
| 11295 | case ImplicitAllocatorIdContext: |
| 11296 | result->value.type = parent_fn_type->async_allocator_type; |
| 11297 | break; |
| 11298 | case ImplicitAllocatorIdAlloc: |
| 11299 | { |
| 11300 | assert(parent_fn_type->async_allocator_type->id == TypeTableEntryIdPointer); |
| 11301 | TypeTableEntry *struct_type = parent_fn_type->async_allocator_type->data.pointer.child_type; |
| 11302 | TypeStructField *alloc_fn_field = find_struct_type_field(struct_type, buf_create_from_str(ASYNC_ALLOC_FIELD_NAME)); |
| 11303 | assert(alloc_fn_field->type_entry->id == TypeTableEntryIdFn); |
| 11304 | result->value.type = alloc_fn_field->type_entry; |
| 11305 | break; |
| 11306 | } |
| 11307 | case ImplicitAllocatorIdFree: |
| 11308 | { |
| 11309 | assert(parent_fn_type->async_allocator_type->id == TypeTableEntryIdPointer); |
| 11310 | TypeTableEntry *struct_type = parent_fn_type->async_allocator_type->data.pointer.child_type; |
| 11311 | TypeStructField *free_fn_field = find_struct_type_field(struct_type, buf_create_from_str(ASYNC_FREE_FIELD_NAME)); |
| 11312 | assert(free_fn_field->type_entry->id == TypeTableEntryIdFn); |
| 11313 | result->value.type = free_fn_field->type_entry; |
| 11314 | break; |
| 11315 | } |
| 11316 | } |
| 11285 | 11317 | return result; |
| 11286 | 11318 | } |
| 11287 | 11319 | |
| 11288 | 11320 | static IrInstruction *ir_analyze_async_call(IrAnalyze *ira, IrInstructionCall *call_instruction, FnTableEntry *fn_entry, TypeTableEntry *fn_type, |
| 11289 | | IrInstruction *fn_ref, IrInstruction **casted_args, size_t arg_count, IrInstruction *async_allocator_inst) |
| 11321 | IrInstruction *fn_ref, IrInstruction **casted_args, size_t arg_count, IrInstruction *async_allocator_inst, IrInstruction *alloc_fn, IrInstruction *free_fn) |
| 11290 | 11322 | { |
| 11291 | | Buf *alloc_field_name = buf_create_from_str(ASYNC_ALLOC_FIELD_NAME); |
| 11292 | | //Buf *free_field_name = buf_create_from_str("freeFn"); |
| 11293 | 11323 | assert(async_allocator_inst->value.type->id == TypeTableEntryIdPointer); |
| 11294 | | TypeTableEntry *container_type = async_allocator_inst->value.type->data.pointer.child_type; |
| 11295 | | IrInstruction *field_ptr_inst = ir_analyze_container_field_ptr(ira, alloc_field_name, &call_instruction->base, |
| 11296 | | async_allocator_inst, container_type); |
| 11297 | | if (type_is_invalid(field_ptr_inst->value.type)) { |
| 11298 | | return ira->codegen->invalid_instruction; |
| 11299 | | } |
| 11300 | | TypeTableEntry *ptr_to_alloc_fn_type = field_ptr_inst->value.type; |
| 11301 | | assert(ptr_to_alloc_fn_type->id == TypeTableEntryIdPointer); |
| 11302 | 11324 | |
| 11303 | | TypeTableEntry *alloc_fn_type = ptr_to_alloc_fn_type->data.pointer.child_type; |
| 11325 | TypeTableEntry *alloc_fn_type = alloc_fn->value.type; |
| 11304 | 11326 | if (alloc_fn_type->id != TypeTableEntryIdFn) { |
| 11305 | 11327 | ir_add_error(ira, &call_instruction->base, |
| 11306 | 11328 | buf_sprintf("expected allocation function, found '%s'", buf_ptr(&alloc_fn_type->name))); |
| ... | ... | @@ -11319,7 +11341,7 @@ static IrInstruction *ir_analyze_async_call(IrAnalyze *ira, IrInstructionCall *c |
| 11319 | 11341 | TypeTableEntry *async_return_type = get_error_union_type(ira->codegen, alloc_fn_error_set_type, promise_type); |
| 11320 | 11342 | |
| 11321 | 11343 | IrInstruction *result = ir_build_call(&ira->new_irb, call_instruction->base.scope, call_instruction->base.source_node, |
| 11322 | | fn_entry, fn_ref, arg_count, casted_args, false, FnInlineAuto, true, async_allocator_inst); |
| 11344 | fn_entry, fn_ref, arg_count, casted_args, false, FnInlineAuto, true, async_allocator_inst, alloc_fn, free_fn); |
| 11323 | 11345 | result->value.type = async_return_type; |
| 11324 | 11346 | return result; |
| 11325 | 11347 | } |
| ... | ... | @@ -11842,7 +11864,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal |
| 11842 | 11864 | } |
| 11843 | 11865 | IrInstruction *uncasted_async_allocator_inst; |
| 11844 | 11866 | if (call_instruction->async_allocator == nullptr) { |
| 11845 | | uncasted_async_allocator_inst = ir_get_implicit_allocator(ira, &call_instruction->base); |
| 11867 | uncasted_async_allocator_inst = ir_get_implicit_allocator(ira, &call_instruction->base, ImplicitAllocatorIdContext); |
| 11846 | 11868 | if (type_is_invalid(uncasted_async_allocator_inst->value.type)) |
| 11847 | 11869 | return ira->codegen->builtin_types.entry_invalid; |
| 11848 | 11870 | } else { |
| ... | ... | @@ -11886,15 +11908,25 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal |
| 11886 | 11908 | |
| 11887 | 11909 | size_t impl_param_count = impl_fn->type_entry->data.fn.fn_type_id.param_count; |
| 11888 | 11910 | if (call_instruction->is_async) { |
| 11889 | | IrInstruction *result = ir_analyze_async_call(ira, call_instruction, impl_fn, impl_fn->type_entry, fn_ref, casted_args, impl_param_count, async_allocator_inst); |
| 11911 | IrInstruction *alloc_fn = call_instruction->alloc_fn->other; |
| 11912 | if (type_is_invalid(alloc_fn->value.type)) |
| 11913 | return ira->codegen->builtin_types.entry_invalid; |
| 11914 | |
| 11915 | IrInstruction *free_fn = call_instruction->free_fn->other; |
| 11916 | if (type_is_invalid(free_fn->value.type)) |
| 11917 | return ira->codegen->builtin_types.entry_invalid; |
| 11918 | |
| 11919 | IrInstruction *result = ir_analyze_async_call(ira, call_instruction, impl_fn, impl_fn->type_entry, fn_ref, casted_args, impl_param_count, |
| 11920 | async_allocator_inst, alloc_fn, free_fn); |
| 11890 | 11921 | ir_link_new_instruction(result, &call_instruction->base); |
| 11891 | 11922 | ir_add_alloca(ira, result, result->value.type); |
| 11892 | 11923 | return ir_finish_anal(ira, result->value.type); |
| 11893 | 11924 | } |
| 11894 | 11925 | |
| 11926 | assert(async_allocator_inst == nullptr); |
| 11895 | 11927 | IrInstruction *new_call_instruction = ir_build_call_from(&ira->new_irb, &call_instruction->base, |
| 11896 | 11928 | impl_fn, nullptr, impl_param_count, casted_args, false, fn_inline, |
| 11897 | | call_instruction->is_async, async_allocator_inst); |
| 11929 | call_instruction->is_async, nullptr, nullptr, nullptr); |
| 11898 | 11930 | |
| 11899 | 11931 | ir_add_alloca(ira, new_call_instruction, return_type); |
| 11900 | 11932 | |
| ... | ... | @@ -11961,20 +11993,40 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal |
| 11961 | 11993 | |
| 11962 | 11994 | if (call_instruction->is_async) { |
| 11963 | 11995 | IrInstruction *uncasted_async_allocator_inst; |
| 11996 | IrInstruction *uncasted_alloc_fn_inst; |
| 11997 | IrInstruction *uncasted_free_fn_inst; |
| 11964 | 11998 | if (call_instruction->async_allocator == nullptr) { |
| 11965 | | uncasted_async_allocator_inst = ir_get_implicit_allocator(ira, &call_instruction->base); |
| 11999 | uncasted_async_allocator_inst = ir_get_implicit_allocator(ira, &call_instruction->base, ImplicitAllocatorIdContext); |
| 11966 | 12000 | if (type_is_invalid(uncasted_async_allocator_inst->value.type)) |
| 11967 | 12001 | return ira->codegen->builtin_types.entry_invalid; |
| 12002 | |
| 12003 | uncasted_alloc_fn_inst = ir_get_implicit_allocator(ira, &call_instruction->base, ImplicitAllocatorIdAlloc); |
| 12004 | if (type_is_invalid(uncasted_alloc_fn_inst->value.type)) |
| 12005 | return ira->codegen->builtin_types.entry_invalid; |
| 12006 | |
| 12007 | uncasted_free_fn_inst = ir_get_implicit_allocator(ira, &call_instruction->base, ImplicitAllocatorIdFree); |
| 12008 | if (type_is_invalid(uncasted_free_fn_inst->value.type)) |
| 12009 | return ira->codegen->builtin_types.entry_invalid; |
| 11968 | 12010 | } else { |
| 11969 | 12011 | uncasted_async_allocator_inst = call_instruction->async_allocator->other; |
| 11970 | 12012 | if (type_is_invalid(uncasted_async_allocator_inst->value.type)) |
| 11971 | 12013 | return ira->codegen->builtin_types.entry_invalid; |
| 12014 | |
| 12015 | uncasted_alloc_fn_inst = call_instruction->alloc_fn->other; |
| 12016 | if (type_is_invalid(uncasted_alloc_fn_inst->value.type)) |
| 12017 | return ira->codegen->builtin_types.entry_invalid; |
| 12018 | |
| 12019 | uncasted_free_fn_inst = call_instruction->free_fn->other; |
| 12020 | if (type_is_invalid(uncasted_free_fn_inst->value.type)) |
| 12021 | return ira->codegen->builtin_types.entry_invalid; |
| 12022 | |
| 11972 | 12023 | } |
| 11973 | 12024 | IrInstruction *async_allocator_inst = ir_implicit_cast(ira, uncasted_async_allocator_inst, fn_type_id->async_allocator_type); |
| 11974 | 12025 | if (type_is_invalid(async_allocator_inst->value.type)) |
| 11975 | 12026 | return ira->codegen->builtin_types.entry_invalid; |
| 11976 | 12027 | |
| 11977 | | IrInstruction *result = ir_analyze_async_call(ira, call_instruction, fn_entry, fn_type, fn_ref, casted_args, call_param_count, async_allocator_inst); |
| 12028 | IrInstruction *result = ir_analyze_async_call(ira, call_instruction, fn_entry, fn_type, fn_ref, casted_args, call_param_count, |
| 12029 | async_allocator_inst, uncasted_alloc_fn_inst, uncasted_free_fn_inst); |
| 11978 | 12030 | ir_link_new_instruction(result, &call_instruction->base); |
| 11979 | 12031 | ir_add_alloca(ira, result, result->value.type); |
| 11980 | 12032 | return ir_finish_anal(ira, result->value.type); |
| ... | ... | @@ -11982,7 +12034,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal |
| 11982 | 12034 | |
| 11983 | 12035 | |
| 11984 | 12036 | IrInstruction *new_call_instruction = ir_build_call_from(&ira->new_irb, &call_instruction->base, |
| 11985 | | fn_entry, fn_ref, call_param_count, casted_args, false, fn_inline, false, nullptr); |
| 12037 | fn_entry, fn_ref, call_param_count, casted_args, false, fn_inline, false, nullptr, nullptr, nullptr); |
| 11986 | 12038 | |
| 11987 | 12039 | ir_add_alloca(ira, new_call_instruction, return_type); |
| 11988 | 12040 | return ir_finish_anal(ira, return_type); |
| ... | ... | @@ -17222,7 +17274,7 @@ static TypeTableEntry *ir_analyze_instruction_coro_begin(IrAnalyze *ira, IrInstr |
| 17222 | 17274 | } |
| 17223 | 17275 | |
| 17224 | 17276 | static TypeTableEntry *ir_analyze_instruction_get_implicit_allocator(IrAnalyze *ira, IrInstructionGetImplicitAllocator *instruction) { |
| 17225 | | IrInstruction *result = ir_get_implicit_allocator(ira, &instruction->base); |
| 17277 | IrInstruction *result = ir_get_implicit_allocator(ira, &instruction->base, instruction->id); |
| 17226 | 17278 | ir_link_new_instruction(result, &instruction->base); |
| 17227 | 17279 | return result->value.type; |
| 17228 | 17280 | } |