mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Add Expr::ErasedLoad
This commit is contained in:
parent
2c838aa5c2
commit
283b9d53d6
11 changed files with 92 additions and 17 deletions
|
@ -14,6 +14,7 @@ use roc_error_macros::internal_error;
|
|||
use roc_module::low_level::LowLevel;
|
||||
use roc_module::{low_level::LowLevelWrapperType, symbol::Symbol};
|
||||
|
||||
use crate::ir::ErasedField;
|
||||
use crate::{
|
||||
borrow::{lowlevel_borrow_signature, Ownership},
|
||||
ir::{
|
||||
|
@ -897,6 +898,15 @@ fn insert_refcount_operations_binding<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
Expr::ErasedLoad { symbol, field } => {
|
||||
let new_let = new_let!(stmt);
|
||||
|
||||
match field {
|
||||
ErasedField::Value => inc_owned!([*symbol], new_let),
|
||||
ErasedField::Callee => new_let,
|
||||
}
|
||||
}
|
||||
|
||||
Expr::GetTagId { structure, .. }
|
||||
| Expr::StructAtIndex { structure, .. }
|
||||
| Expr::UnionAtIndex { structure, .. }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue