Store specialized variable for use in dbg as fake symbol in lowlevel call

This commit is contained in:
Ayaz Hafiz 2022-12-14 16:23:08 -06:00
parent fe90355265
commit a96225e92e
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
6 changed files with 48 additions and 8 deletions

View file

@ -555,7 +555,13 @@ impl<'a, 'i> Context<'a, 'i> {
match &call_type {
LowLevel { op, .. } => {
let ps = crate::borrow::lowlevel_borrow_signature(self.arena, *op);
let b = self.add_dec_after_lowlevel(arguments, ps, b, b_live_vars);
let b = match op {
roc_module::low_level::LowLevel::Dbg => {
// NB(dbg-spec-var) second var is the Variable
self.add_dec_after_lowlevel(&arguments[..1], ps, b, b_live_vars)
}
_ => self.add_dec_after_lowlevel(arguments, ps, b, b_live_vars),
};
let v = Expr::Call(crate::ir::Call {
call_type,