From 236bbe1183575d7644f943b59096f2eb275ffa3a Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 21 Feb 2018 00:52:20 -0500 Subject: implement IR analysis for async function calls See #727 --- src/codegen.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 291db7017b..d52cc2f9e2 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2521,6 +2521,10 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr } FnTypeId *fn_type_id = &fn_type->data.fn.fn_type_id; + if (fn_type_id->cc == CallingConventionAsync) { + zig_panic("TODO codegen async function call"); + } + TypeTableEntry *src_return_type = fn_type_id->return_type; bool ret_has_bits = type_has_bits(src_return_type); bool first_arg_ret = ret_has_bits && handle_is_ptr(src_return_type); @@ -3094,6 +3098,10 @@ static LLVMValueRef ir_render_cancel(CodeGen *g, IrExecutable *executable, IrIns zig_panic("TODO ir_render_cancel"); } +static LLVMValueRef ir_render_get_implicit_allocator(CodeGen *g, IrExecutable *executable, IrInstructionGetImplicitAllocator *instruction) { + zig_panic("TODO ir_render_get_implicit_allocator"); +} + static LLVMAtomicOrdering to_LLVMAtomicOrdering(AtomicOrder atomic_order) { switch (atomic_order) { case AtomicOrderUnordered: return LLVMAtomicOrderingUnordered; @@ -3752,6 +3760,7 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, case IrInstructionIdExport: case IrInstructionIdErrorUnion: zig_unreachable(); + case IrInstructionIdReturn: return ir_render_return(g, executable, (IrInstructionReturn *)instruction); case IrInstructionIdDeclVar: @@ -3870,6 +3879,8 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, return ir_render_error_return_trace(g, executable, (IrInstructionErrorReturnTrace *)instruction); case IrInstructionIdCancel: return ir_render_cancel(g, executable, (IrInstructionCancel *)instruction); + case IrInstructionIdGetImplicitAllocator: + return ir_render_get_implicit_allocator(g, executable, (IrInstructionGetImplicitAllocator *)instruction); } zig_unreachable(); } -- cgit v1.2.3