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

@ -35,6 +35,8 @@ pub fn occuring_variables(stmt: &Stmt<'_>) -> (MutSet<Symbol>, MutSet<Symbol>) {
result.insert(*symbol);
}
Unreachable => {}
Inc(symbol, cont) | Dec(symbol, cont) => {
result.insert(*symbol);
stack.push(cont);
@ -673,6 +675,8 @@ impl<'a> Context<'a> {
}
}
Unreachable => (stmt, MutSet::default()),
Jump(j, xs) => {
let empty = MutSet::default();
let j_live_vars = match self.jp_live_vars.get(j) {
@ -813,6 +817,8 @@ pub fn collect_stmt(
vars
}
Unreachable => vars,
RuntimeError(_) => vars,
}
}