This commit is contained in:
Folkert 2023-06-18 17:00:31 +02:00
parent 0247237fe8
commit 9c85fb90d3
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
44 changed files with 2585 additions and 2505 deletions

View file

@ -30,7 +30,8 @@ pub fn basic_type_from_layout<'a, 'ctx, 'env>(
layout_interner,
layout_interner.get_repr(lambda_set.runtime_representation()),
),
Boxed(inner_layout) => {
Ptr(inner_layout) | Boxed(inner_layout) => {
let inner_type = basic_type_from_layout(
env,
layout_interner,
@ -41,12 +42,6 @@ pub fn basic_type_from_layout<'a, 'ctx, 'env>(
}
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()

View file

@ -28,8 +28,8 @@ use crate::llvm::{
},
build::{
cast_basic_basic, complex_bitcast_check_size, create_entry_block_alloca,
function_value_by_func_spec, load_roc_value, roc_function_call, tag_pointer_clear_tag_id,
BuilderExt, RocReturn,
entry_block_alloca_zerofill, function_value_by_func_spec, load_roc_value,
roc_function_call, tag_pointer_clear_tag_id, BuilderExt, RocReturn,
},
build_list::{
list_append_unsafe, list_concat, list_drop_at, list_get_unsafe, list_len, list_map,
@ -1323,7 +1323,15 @@ pub(crate) fn run_low_level<'a, 'ctx>(
.new_build_load(element_type, ptr.into_pointer_value(), "ptr_load")
}
PtrToZeroed => todo!(),
PtrToStackValue => {
arguments!(initial_value);
let ptr = entry_block_alloca_zerofill(env, initial_value.get_type(), "stack_value");
env.builder.build_store(ptr, initial_value);
ptr.into()
}
RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr | RefCountDecDataPtr => {
unreachable!("Not used in LLVM backend: {:?}", op);