add unreachable instruction to the mono IR

This commit is contained in:
Folkert 2021-01-01 02:26:56 +01:00
parent ccd302cbe9
commit 6bc0cf33a5
6 changed files with 22 additions and 2 deletions

View file

@ -754,6 +754,7 @@ pub enum Stmt<'a> {
ret_layout: Layout<'a>,
},
Ret(Symbol),
Unreachable,
Inc(Symbol, &'a Stmt<'a>),
Dec(Symbol, &'a Stmt<'a>),
Join {
@ -1103,6 +1104,8 @@ impl<'a> Stmt<'a> {
.append(symbol_to_doc(alloc, *symbol))
.append(";"),
Unreachable => alloc.text("unreachable;"),
Switch {
cond_symbol,
branches,
@ -4436,6 +4439,8 @@ fn substitute_in_stmt_help<'a>(
}
}
Unreachable => None,
RuntimeError(_) => None,
}
}