| ... | ... | @@ -4146,6 +4146,15 @@ static LLVMValueRef ir_render_frame_address(CodeGen *g, IrExecutable *executable |
| 4146 | 4146 | return LLVMBuildCall(g->builder, get_frame_address_fn_val(g), &zero, 1, ""); |
| 4147 | 4147 | } |
| 4148 | 4148 | |
| 4149 | static LLVMValueRef ir_render_handle(CodeGen *g, IrExecutable *executable, |
| 4150 | IrInstructionHandle *instruction) |
| 4151 | { |
| 4152 | // @andrewrk, not sure what to place here ? |
| 4153 | // `get_promise_frame_type` ? |
| 4154 | LLVMValueRef handle = LLVMConstNull(g->builtin_types.entry_promise->type_ref); |
| 4155 | return LLVMBuildRet(g->builder, handle); |
| 4156 | } |
| 4157 | |
| 4149 | 4158 | static LLVMValueRef render_shl_with_overflow(CodeGen *g, IrInstructionOverflowOp *instruction) { |
| 4150 | 4159 | TypeTableEntry *int_type = instruction->result_ptr_type; |
| 4151 | 4160 | assert(int_type->id == TypeTableEntryIdInt); |
| ... | ... | @@ -4910,6 +4919,8 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, |
| 4910 | 4919 | return ir_render_return_address(g, executable, (IrInstructionReturnAddress *)instruction); |
| 4911 | 4920 | case IrInstructionIdFrameAddress: |
| 4912 | 4921 | return ir_render_frame_address(g, executable, (IrInstructionFrameAddress *)instruction); |
| 4922 | case IrInstructionIdHandle: |
| 4923 | return ir_render_handle(g, executable, (IrInstructionHandle *)instruction); |
| 4913 | 4924 | case IrInstructionIdOverflowOp: |
| 4914 | 4925 | return ir_render_overflow_op(g, executable, (IrInstructionOverflowOp *)instruction); |
| 4915 | 4926 | case IrInstructionIdTestErr: |
| ... | ... | @@ -6344,6 +6355,7 @@ static void define_builtin_fns(CodeGen *g) { |
| 6344 | 6355 | create_builtin_fn(g, BuiltinFnIdBreakpoint, "breakpoint", 0); |
| 6345 | 6356 | create_builtin_fn(g, BuiltinFnIdReturnAddress, "returnAddress", 0); |
| 6346 | 6357 | create_builtin_fn(g, BuiltinFnIdFrameAddress, "frameAddress", 0); |
| 6358 | create_builtin_fn(g, BuiltinFnIdHandle, "handle", 0); |
| 6347 | 6359 | create_builtin_fn(g, BuiltinFnIdMemcpy, "memcpy", 3); |
| 6348 | 6360 | create_builtin_fn(g, BuiltinFnIdMemset, "memset", 3); |
| 6349 | 6361 | create_builtin_fn(g, BuiltinFnIdSizeof, "sizeOf", 1); |