| ... | @@ -4149,9 +4149,15 @@ static LLVMValueRef ir_render_frame_address(CodeGen *g, IrExecutable *executable | ... | @@ -4149,9 +4149,15 @@ static LLVMValueRef ir_render_frame_address(CodeGen *g, IrExecutable *executable |
| 4149 | static LLVMValueRef ir_render_handle(CodeGen *g, IrExecutable *executable, | 4149 | static LLVMValueRef ir_render_handle(CodeGen *g, IrExecutable *executable, |
| 4150 | IrInstructionHandle *instruction) | 4150 | IrInstructionHandle *instruction) |
| 4151 | { | 4151 | { |
| 4152 | // @andrewrk, not sure what to place here ? | 4152 | |
| 4153 | // `get_promise_frame_type` ? | 4153 | bool is_async = executable->fn_entry != nullptr && |
| 4154 | LLVMValueRef handle = LLVMConstNull(g->builtin_types.entry_promise->type_ref); | 4154 | executable->fn_entry->type_entry->data.fn.fn_type_id.cc == CallingConventionAsync; |
| | 4155 | |
| | 4156 | if (!is_async || !executable->coro_handle) { |
| | 4157 | return LLVMConstNull(g->builtin_types.entry_promise->type_ref); |
| | 4158 | } |
| | 4159 | |
| | 4160 | LLVMValueRef handle = ir_llvm_value(g, executable->coro_handle); |
| 4155 | return LLVMBuildRet(g->builder, handle); | 4161 | return LLVMBuildRet(g->builder, handle); |
| 4156 | } | 4162 | } |
| 4157 | | 4163 | |