Add Expr::ErasedLoad

This commit is contained in:
Ayaz Hafiz 2023-07-02 11:48:21 -05:00
parent 2c838aa5c2
commit 283b9d53d6
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
11 changed files with 92 additions and 17 deletions

View file

@ -17,8 +17,8 @@ use roc_module::low_level::LowLevel;
use roc_module::symbol::{IdentIds, ModuleId, Symbol};
use crate::ir::{
BranchInfo, Call, CallType, Expr, JoinPointId, ListLiteralElement, Literal, ModifyRc, Proc,
ProcLayout, Stmt, UpdateModeId,
BranchInfo, Call, CallType, ErasedField, Expr, JoinPointId, ListLiteralElement, Literal,
ModifyRc, Proc, ProcLayout, Stmt, UpdateModeId,
};
use crate::layout::{
Builtin, InLayout, Layout, LayoutInterner, LayoutRepr, STLayoutInterner, UnionLayout,
@ -233,6 +233,16 @@ fn specialize_drops_stmt<'a, 'i>(
environment.add_struct_child(*binding, *value, 0);
}
}
ErasedLoad { symbol, field } => {
match field {
ErasedField::Value => {
environment.add_struct_child(*symbol, *binding, 0);
}
ErasedField::Callee => {
// nothing to own
}
}
}
Reset { .. } | Expr::ResetRef { .. } => { /* do nothing */ }
RuntimeErrorFunction(_)
| FunctionPointer { .. }