authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-02-22 09:36:58-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-02-22 09:36:58-05:00
log88e7b9bf80ef261be23ab5a427f6f10604225be1
treebf667d0675c3f2c5a99aaa79d2637fa46d37cf20
parent37c07d4f3f52f2227e86943cf84aebdc729684b7

ir analysis for coro_id and coro_alloc

See #727

1 files changed, 13 insertions(+), 2 deletions(-)

src/ir.cpp+13-2
......@@ -16807,11 +16807,22 @@ static TypeTableEntry *ir_analyze_instruction_cancel(IrAnalyze *ira, IrInstructi
1680716807}
1680816808
1680916809static TypeTableEntry *ir_analyze_instruction_coro_id(IrAnalyze *ira, IrInstructionCoroId *instruction) {
16810 zig_panic("TODO ir_analyze_instruction_coro_id");
16810 IrInstruction *result = ir_build_coro_id(&ira->new_irb, instruction->base.scope, instruction->base.source_node);
16811 ir_link_new_instruction(result, &instruction->base);
16812 result->value.type = ira->codegen->builtin_types.entry_usize;
16813 return result->value.type;
1681116814}
1681216815
1681316816static TypeTableEntry *ir_analyze_instruction_coro_alloc(IrAnalyze *ira, IrInstructionCoroAlloc *instruction) {
16814 zig_panic("TODO ir_analyze_instruction_coro_alloc");
16817 IrInstruction *coro_id = instruction->coro_id->other;
16818 if (type_is_invalid(coro_id->value.type))
16819 return ira->codegen->builtin_types.entry_invalid;
16820
16821 IrInstruction *result = ir_build_coro_alloc(&ira->new_irb, instruction->base.scope, instruction->base.source_node,
16822 coro_id);
16823 ir_link_new_instruction(result, &instruction->base);
16824 result->value.type = ira->codegen->builtin_types.entry_bool;
16825 return result->value.type;
1681516826}
1681616827
1681716828static TypeTableEntry *ir_analyze_instruction_coro_size(IrAnalyze *ira, IrInstructionCoroSize *instruction) {