Remove all box references

This commit is contained in:
Ayaz Hafiz 2023-07-12 15:50:00 -05:00
parent b5db3f68e1
commit a8d821bf87
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
9 changed files with 39 additions and 148 deletions

View file

@ -1106,42 +1106,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",
)
}
FunctionPointer { lambda_name } => {
let alloca = fn_ptr::build(env, *lambda_name);
alloca.into()