This commit is contained in:
Brendan Hansknecht 2024-04-09 19:52:30 -07:00
parent e31479f664
commit f87c32ca7d
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
2 changed files with 1 additions and 53 deletions

View file

@ -507,36 +507,6 @@ pub(crate) fn list_len_usize<'ctx>(
.into_int_value()
}
pub(crate) fn list_capacity_or_ref_ptr<'ctx>(
builder: &Builder<'ctx>,
wrapper_struct: StructValue<'ctx>,
) -> IntValue<'ctx> {
builder
.build_extract_value(
wrapper_struct,
Builtin::WRAPPER_CAPACITY,
"list_capacity_or_ref_ptr",
)
.unwrap()
.into_int_value()
}
// Gets a pointer to just after the refcount for a list or seamless slice.
// The value is just after the refcount so that normal lists and seamless slices can share code paths easily.
pub(crate) fn list_allocation_ptr<'ctx>(
env: &Env<'_, 'ctx, '_>,
wrapper_struct: StructValue<'ctx>,
) -> PointerValue<'ctx> {
call_list_bitcode_fn(
env,
&[wrapper_struct],
&[],
BitcodeReturns::Basic,
bitcode::LIST_ALLOCATION_PTR,
)
.into_pointer_value()
}
pub(crate) fn destructure<'ctx>(
builder: &Builder<'ctx>,
wrapper_struct: StructValue<'ctx>,
@ -878,21 +848,6 @@ pub(crate) fn empty_polymorphic_list<'ctx>(env: &Env<'_, 'ctx, '_>) -> BasicValu
BasicValueEnum::StructValue(struct_type.const_zero())
}
pub(crate) fn load_list<'ctx>(
builder: &Builder<'ctx>,
wrapper_struct: StructValue<'ctx>,
ptr_type: PointerType<'ctx>,
) -> (IntValue<'ctx>, PointerValue<'ctx>) {
let ptr = load_list_ptr(builder, wrapper_struct, ptr_type);
let length = builder
.build_extract_value(wrapper_struct, Builtin::WRAPPER_LEN, "list_len")
.unwrap()
.into_int_value();
(length, ptr)
}
pub(crate) fn load_list_ptr<'ctx>(
builder: &Builder<'ctx>,
wrapper_struct: StructValue<'ctx>,