remove Boxed layout

This commit is contained in:
Folkert 2023-07-05 18:57:29 +02:00
parent d64930c17f
commit 6d2d65bb1e
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
24 changed files with 52 additions and 1377 deletions

View file

@ -18,7 +18,7 @@ use roc_mono::layout::{
use roc_region::all::Region;
use super::build::BuilderExt;
use super::build::{add_func, load_roc_value, FunctionSpec, LlvmBackendMode};
use super::build::{add_func, FunctionSpec, LlvmBackendMode};
use super::convert::struct_type_from_union_layout;
use super::scope::Scope;
use super::struct_::RocStruct;
@ -353,43 +353,6 @@ fn build_clone<'a, 'ctx>(
}
}
LayoutRepr::Boxed(inner_layout) => {
// write the offset
build_copy(env, ptr, cursors.offset, cursors.extra_offset.into());
let source = value.into_pointer_value();
let value = load_roc_value(
env,
layout_interner,
layout_interner.get_repr(inner_layout),
source,
"inner",
);
let inner_width = env
.ptr_int()
.const_int(layout_interner.stack_size(inner_layout) as u64, false);
let new_extra = env
.builder
.build_int_add(cursors.offset, inner_width, "new_extra");
let cursors = Cursors {
offset: cursors.extra_offset,
extra_offset: new_extra,
};
build_clone(
env,
layout_interner,
layout_ids,
ptr,
cursors,
value,
layout_interner.get_repr(inner_layout),
)
}
LayoutRepr::Ptr(_) => {
unreachable!("for internal use only")
}