Add Reuse and Reset to last seen map

This commit is contained in:
Brendan Hansknecht 2020-11-19 12:12:42 -08:00
parent 0cee2cd96f
commit 65e14f2941

View file

@ -14,6 +14,7 @@
use bumpalo::Bump; use bumpalo::Bump;
use object::write::Object; use object::write::Object;
use roc_collections::all::{MutMap, MutSet}; use roc_collections::all::{MutMap, MutSet};
use roc_module::ident::TagName;
use roc_module::symbol::{Interns, Symbol}; use roc_module::symbol::{Interns, Symbol};
use roc_mono::ir::{CallType, Expr, JoinPointId, Literal, Proc, Stmt}; use roc_mono::ir::{CallType, Expr, JoinPointId, Literal, Proc, Stmt};
use roc_mono::layout::Layout; use roc_mono::layout::Layout;
@ -199,11 +200,28 @@ where
self.set_last_seen(*sym, stmt); self.set_last_seen(*sym, stmt);
} }
} }
Expr::Reuse { .. } => { Expr::Reuse {
// Not sure what this is used for so leaving it blank for now. symbol,
arguments,
tag_name,
..
} => {
self.set_last_seen(*symbol, stmt);
match tag_name {
TagName::Closure(sym) => {
self.set_last_seen(*sym, stmt);
} }
Expr::Reset(_sym) => { TagName::Private(sym) => {
// Not sure what this is used for so leaving it blank for now. self.set_last_seen(*sym, stmt);
}
TagName::Global(_) => {}
}
for sym in *arguments {
self.set_last_seen(*sym, stmt);
}
}
Expr::Reset(sym) => {
self.set_last_seen(*sym, stmt);
} }
Expr::EmptyArray => {} Expr::EmptyArray => {}
Expr::RuntimeErrorFunction(_) => {} Expr::RuntimeErrorFunction(_) => {}