aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-02-21 00:52:20 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-02-21 00:52:20 -0500
commit236bbe1183575d7644f943b59096f2eb275ffa3a (patch)
treeef6d24009aefc23f7a4c305aba806cad83066ff0 /src/codegen.cpp
parent65a51b401cfe17daee0c64404c8f564b0f282224 (diff)
downloadzig-236bbe1183575d7644f943b59096f2eb275ffa3a.tar.gz
zig-236bbe1183575d7644f943b59096f2eb275ffa3a.zip
implement IR analysis for async function calls
See #727
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp11
1 files changed, 11 insertions, 0 deletions
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();
}