mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
remove Boxed layout
This commit is contained in:
parent
d64930c17f
commit
6d2d65bb1e
24 changed files with 52 additions and 1377 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue