aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-06-06 15:16:24 +0100
committergingerBill <bill@gingerbill.org>2020-06-06 15:16:24 +0100
commit59a0bbb38512054eb5c6fc83383c3638ed03d1bf (patch)
treebd7f9e00f72a9b0d1c20e6eddd9251e0012e8070 /src/ir.cpp
parenta3fa647bfd579e38337cff173a672159d42f7fd6 (diff)
Improve termination rules checking for missing `return`; Make diverging procedure `-> !` be terminators
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 381c24459..04623f65f 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -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);