mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
remove box and unbox expressions
This commit is contained in:
parent
a9813aeae7
commit
d64930c17f
12 changed files with 9 additions and 196 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue