mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-13 07:16:18 +00:00
start resetref
This commit is contained in:
parent
61efec6fe2
commit
d4ed6f7778
13 changed files with 214 additions and 18 deletions
|
@ -1935,6 +1935,13 @@ pub enum Expr<'a> {
|
|||
update_mode: UpdateModeId,
|
||||
},
|
||||
|
||||
// Just like Reset, but does not recursively decrement the children.
|
||||
// Used in reuse analysis to replace a decref with a resetRef to avoid decrementing when the dec ref didn't.
|
||||
ResetRef {
|
||||
symbol: Symbol,
|
||||
update_mode: UpdateModeId,
|
||||
},
|
||||
|
||||
RuntimeErrorFunction(&'a str),
|
||||
}
|
||||
|
||||
|
@ -2057,7 +2064,13 @@ impl<'a> Expr<'a> {
|
|||
"Reset {{ symbol: {:?}, id: {} }}",
|
||||
symbol, update_mode.id
|
||||
)),
|
||||
|
||||
ResetRef {
|
||||
symbol,
|
||||
update_mode,
|
||||
} => alloc.text(format!(
|
||||
"ResetRef {{ symbol: {:?}, id: {} }}",
|
||||
symbol, update_mode.id
|
||||
)),
|
||||
Struct(args) => {
|
||||
let it = args.iter().map(|s| symbol_to_doc(alloc, *s, pretty));
|
||||
|
||||
|
@ -7187,7 +7200,9 @@ fn substitute_in_expr<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
Reuse { .. } | Reset { .. } => unreachable!("reset/reuse have not been introduced yet"),
|
||||
Reuse { .. } | Reset { .. } | ResetRef { .. } => {
|
||||
unreachable!("reset/resetref/reuse have not been introduced yet")
|
||||
}
|
||||
|
||||
Struct(args) => {
|
||||
let mut did_change = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue