mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
fixed rc for debug/expect
This commit is contained in:
parent
f5feec1e6c
commit
9e74a2cc8c
1 changed files with 6 additions and 29 deletions
|
@ -648,20 +648,13 @@ fn insert_refcount_operations_stmt<'v, 'a>(
|
|||
} => {
|
||||
let new_remainder = insert_refcount_operations_stmt(arena, environment, remainder);
|
||||
|
||||
let new_expect = arena.alloc(Stmt::Expect {
|
||||
arena.alloc(Stmt::Expect {
|
||||
condition: *condition,
|
||||
region: *region,
|
||||
lookups,
|
||||
variables,
|
||||
remainder: new_remainder,
|
||||
});
|
||||
|
||||
consume_and_insert_inc_stmts(
|
||||
arena,
|
||||
environment,
|
||||
environment.owned_usages(lookups.iter().copied()),
|
||||
new_expect,
|
||||
)
|
||||
})
|
||||
}
|
||||
Stmt::ExpectFx {
|
||||
condition,
|
||||
|
@ -672,20 +665,13 @@ fn insert_refcount_operations_stmt<'v, 'a>(
|
|||
} => {
|
||||
let new_remainder = insert_refcount_operations_stmt(arena, environment, remainder);
|
||||
|
||||
let new_expectfx = arena.alloc(Stmt::ExpectFx {
|
||||
arena.alloc(Stmt::ExpectFx {
|
||||
condition: *condition,
|
||||
region: *region,
|
||||
lookups,
|
||||
variables,
|
||||
remainder: new_remainder,
|
||||
});
|
||||
|
||||
consume_and_insert_inc_stmts(
|
||||
arena,
|
||||
environment,
|
||||
environment.owned_usages(lookups.iter().copied()),
|
||||
new_expectfx,
|
||||
)
|
||||
})
|
||||
}
|
||||
Stmt::Dbg {
|
||||
symbol,
|
||||
|
@ -694,20 +680,11 @@ fn insert_refcount_operations_stmt<'v, 'a>(
|
|||
} => {
|
||||
let new_remainder = insert_refcount_operations_stmt(arena, environment, remainder);
|
||||
|
||||
let new_debug = arena.alloc(Stmt::Dbg {
|
||||
arena.alloc(Stmt::Dbg {
|
||||
symbol: *symbol,
|
||||
variable: *variable,
|
||||
remainder: new_remainder,
|
||||
});
|
||||
|
||||
// TODO this assumes the debug statement to consume the variable. I'm not sure if that is (always) the case.
|
||||
// But the old inc_dec pass passes variables
|
||||
consume_and_insert_inc_stmts(
|
||||
arena,
|
||||
environment,
|
||||
environment.owned_usages([*symbol]),
|
||||
new_debug,
|
||||
)
|
||||
})
|
||||
}
|
||||
Stmt::Join {
|
||||
id: joinpoint_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue