mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
add LayoutRepr::Ptr
This commit is contained in:
parent
a9f7961b52
commit
17512873e8
18 changed files with 62 additions and 8 deletions
|
@ -120,7 +120,7 @@ impl<'a> LlvmAlignment<'a> for LayoutRepr<'a> {
|
|||
.llvm_alignment_bytes(interner),
|
||||
Builtin(builtin) => builtin.llvm_alignment_bytes(interner),
|
||||
RecursivePointer(_) => interner.target_info().ptr_width() as u32,
|
||||
Boxed(_) => interner.target_info().ptr_width() as u32,
|
||||
Ptr(_) | Boxed(_) => interner.target_info().ptr_width() as u32,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ fn build_eq<'a, 'ctx>(
|
|||
rhs_val,
|
||||
),
|
||||
|
||||
LayoutRepr::Boxed(inner_layout) => build_box_eq(
|
||||
LayoutRepr::Ptr(inner_layout) | LayoutRepr::Boxed(inner_layout) => build_box_eq(
|
||||
env,
|
||||
layout_interner,
|
||||
layout_ids,
|
||||
|
@ -385,7 +385,7 @@ fn build_neq<'a, 'ctx>(
|
|||
result.into()
|
||||
}
|
||||
|
||||
LayoutRepr::Boxed(inner_layout) => {
|
||||
LayoutRepr::Ptr(inner_layout) | LayoutRepr::Boxed(inner_layout) => {
|
||||
let is_equal = build_box_eq(
|
||||
env,
|
||||
layout_interner,
|
||||
|
|
|
@ -40,6 +40,13 @@ pub fn basic_type_from_layout<'a, 'ctx, 'env>(
|
|||
inner_type.ptr_type(AddressSpace::default()).into()
|
||||
}
|
||||
Union(union_layout) => basic_type_from_union_layout(env, layout_interner, &union_layout),
|
||||
|
||||
Ptr(_) => env
|
||||
.context
|
||||
.i64_type()
|
||||
.ptr_type(AddressSpace::default())
|
||||
.as_basic_type_enum(),
|
||||
|
||||
RecursivePointer(_) => env
|
||||
.context
|
||||
.i64_type()
|
||||
|
|
|
@ -390,6 +390,10 @@ fn build_clone<'a, 'ctx>(
|
|||
)
|
||||
}
|
||||
|
||||
LayoutRepr::Ptr(_) => {
|
||||
unreachable!("for internal use only")
|
||||
}
|
||||
|
||||
LayoutRepr::RecursivePointer(rec_layout) => {
|
||||
let layout = rec_layout;
|
||||
|
||||
|
|
|
@ -537,6 +537,12 @@ fn modify_refcount_layout_build_function<'a, 'ctx>(
|
|||
Some(function)
|
||||
}
|
||||
|
||||
Ptr(_inner) => {
|
||||
debug_assert_eq!(true, false);
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
Union(variant) => {
|
||||
use UnionLayout::*;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue