| ... | @@ -5221,7 +5221,7 @@ static LLVMValueRef ir_render_await(CodeGen *g, IrExecutable *executable, IrInst | ... | @@ -5221,7 +5221,7 @@ static LLVMValueRef ir_render_await(CodeGen *g, IrExecutable *executable, IrInst |
| 5221 | // We either got here from Entry (function call) or from the switch above | 5221 | // We either got here from Entry (function call) or from the switch above |
| 5222 | LLVMValueRef spilled_result_ptr = LLVMBuildPhi(g->builder, usize_type_ref, ""); | 5222 | LLVMValueRef spilled_result_ptr = LLVMBuildPhi(g->builder, usize_type_ref, ""); |
| 5223 | LLVMValueRef incoming_values[] = { LLVMGetParam(g->cur_fn_val, 1), result_ptr_as_usize }; | 5223 | LLVMValueRef incoming_values[] = { LLVMGetParam(g->cur_fn_val, 1), result_ptr_as_usize }; |
| 5224 | LLVMBasicBlockRef incoming_blocks[] = { g->cur_fn->preamble_llvm_block, predecessor_bb }; | 5224 | LLVMBasicBlockRef incoming_blocks[] = { g->cur_preamble_llvm_block, predecessor_bb }; |
| 5225 | LLVMAddIncoming(spilled_result_ptr, incoming_values, incoming_blocks, 2); | 5225 | LLVMAddIncoming(spilled_result_ptr, incoming_values, incoming_blocks, 2); |
| 5226 | | 5226 | |
| 5227 | if (ir_want_runtime_safety(g, &instruction->base)) { | 5227 | if (ir_want_runtime_safety(g, &instruction->base)) { |
| ... | @@ -6428,7 +6428,7 @@ static void build_all_basic_blocks(CodeGen *g, ZigFn *fn) { | ... | @@ -6428,7 +6428,7 @@ static void build_all_basic_blocks(CodeGen *g, ZigFn *fn) { |
| 6428 | LLVMBasicBlockRef first_bb = nullptr; | 6428 | LLVMBasicBlockRef first_bb = nullptr; |
| 6429 | if (fn_is_async(fn)) { | 6429 | if (fn_is_async(fn)) { |
| 6430 | first_bb = LLVMAppendBasicBlock(fn_val, "AsyncSwitch"); | 6430 | first_bb = LLVMAppendBasicBlock(fn_val, "AsyncSwitch"); |
| 6431 | fn->preamble_llvm_block = first_bb; | 6431 | g->cur_preamble_llvm_block = first_bb; |
| 6432 | } | 6432 | } |
| 6433 | for (size_t block_i = 0; block_i < executable->basic_block_list.length; block_i += 1) { | 6433 | for (size_t block_i = 0; block_i < executable->basic_block_list.length; block_i += 1) { |
| 6434 | IrBasicBlock *bb = executable->basic_block_list.at(block_i); | 6434 | IrBasicBlock *bb = executable->basic_block_list.at(block_i); |
| ... | @@ -6771,7 +6771,7 @@ static void do_code_gen(CodeGen *g) { | ... | @@ -6771,7 +6771,7 @@ static void do_code_gen(CodeGen *g) { |
| 6771 | LLVMPositionBuilderAtEnd(g->builder, bad_resume_block); | 6771 | LLVMPositionBuilderAtEnd(g->builder, bad_resume_block); |
| 6772 | gen_assertion_scope(g, PanicMsgIdBadResume, fn_table_entry->child_scope); | 6772 | gen_assertion_scope(g, PanicMsgIdBadResume, fn_table_entry->child_scope); |
| 6773 | | 6773 | |
| 6774 | LLVMPositionBuilderAtEnd(g->builder, fn_table_entry->preamble_llvm_block); | 6774 | LLVMPositionBuilderAtEnd(g->builder, g->cur_preamble_llvm_block); |
| 6775 | render_async_spills(g); | 6775 | render_async_spills(g); |
| 6776 | g->cur_async_awaiter_ptr = LLVMBuildStructGEP(g->builder, g->cur_ret_ptr, coro_awaiter_index, ""); | 6776 | g->cur_async_awaiter_ptr = LLVMBuildStructGEP(g->builder, g->cur_ret_ptr, coro_awaiter_index, ""); |
| 6777 | LLVMValueRef resume_index_ptr = LLVMBuildStructGEP(g->builder, g->cur_ret_ptr, coro_resume_index, ""); | 6777 | LLVMValueRef resume_index_ptr = LLVMBuildStructGEP(g->builder, g->cur_ret_ptr, coro_resume_index, ""); |