mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Add Reuse and Reset to last seen map
This commit is contained in:
parent
0cee2cd96f
commit
65e14f2941
1 changed files with 22 additions and 4 deletions
|
@ -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(_) => {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue