mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
add unreachable instruction to the mono IR
This commit is contained in:
parent
ccd302cbe9
commit
6bc0cf33a5
6 changed files with 22 additions and 2 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue