Improve termination rules checking for missing return; Make diverging procedure -> ! be terminators

This commit is contained in:
gingerBill
2020-06-06 15:16:24 +01:00
parent a3fa647bfd
commit 59a0bbb385
7 changed files with 90 additions and 44 deletions

View File

@@ -3173,6 +3173,10 @@ irValue *ir_emit_call(irProcedure *p, irValue *value, Array<irValue *> const &ar
}
}
defer (if (pt->Proc.diverging) {
ir_emit_unreachable(p);
});
irValue *context_ptr = nullptr;
if (pt->Proc.calling_convention == ProcCC_Odin) {
context_ptr = ir_find_or_generate_context_ptr(p);