remove box and unbox expressions

This commit is contained in:
Folkert 2023-07-05 18:01:00 +02:00
parent a9813aeae7
commit d64930c17f
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
12 changed files with 9 additions and 196 deletions

View file

@ -1084,42 +1084,6 @@ pub(crate) fn build_exp_expr<'a, 'ctx>(
)
}
ExprBox { symbol } => {
let (value, layout) = scope.load_symbol_and_layout(symbol);
let basic_type =
basic_type_from_layout(env, layout_interner, layout_interner.get_repr(layout));
let allocation = reserve_with_refcount_help(
env,
basic_type,
layout_interner.stack_size(layout),
layout_interner.alignment_bytes(layout),
);
store_roc_value(
env,
layout_interner,
layout_interner.get_repr(layout),
allocation,
value,
);
allocation.into()
}
ExprUnbox { symbol } => {
let value = scope.load_symbol(symbol);
debug_assert!(value.is_pointer_value());
load_roc_value(
env,
layout_interner,
layout_interner.get_repr(layout),
value.into_pointer_value(),
"load_boxed_value",
)
}
Reset {
symbol,
update_mode,