mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-13 07:16:18 +00:00
Add Layout::Erased
This commit is contained in:
parent
283b9d53d6
commit
7ea85e44d2
18 changed files with 58 additions and 14 deletions
|
@ -119,7 +119,7 @@ impl<'a> LlvmAlignment<'a> for LayoutRepr<'a> {
|
|||
.runtime_representation()
|
||||
.llvm_alignment_bytes(interner),
|
||||
Builtin(builtin) => builtin.llvm_alignment_bytes(interner),
|
||||
RecursivePointer(_) | Ptr(_) | FunctionPointer(_) => {
|
||||
RecursivePointer(_) | Ptr(_) | FunctionPointer(_) | Erased(_) => {
|
||||
interner.target_info().ptr_width() as u32
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ use inkwell::values::{BasicValueEnum, FunctionValue, IntValue, PointerValue, Str
|
|||
use inkwell::{AddressSpace, FloatPredicate, IntPredicate};
|
||||
use roc_builtins::bitcode;
|
||||
use roc_builtins::bitcode::{FloatWidth, IntWidth};
|
||||
use roc_error_macros::{internal_error, todo_lambda_erasure};
|
||||
use roc_error_macros::internal_error;
|
||||
use roc_module::symbol::Symbol;
|
||||
use roc_mono::layout::{
|
||||
Builtin, InLayout, LayoutIds, LayoutInterner, LayoutRepr, STLayoutInterner, UnionLayout,
|
||||
|
@ -168,6 +168,8 @@ fn build_eq<'a, 'ctx>(
|
|||
),
|
||||
|
||||
LayoutRepr::LambdaSet(_) => unreachable!("cannot compare closures"),
|
||||
LayoutRepr::FunctionPointer(_) => unreachable!("cannot compare function pointers"),
|
||||
LayoutRepr::Erased(_) => unreachable!("cannot compare erased types"),
|
||||
|
||||
LayoutRepr::Union(union_layout) => build_tag_eq(
|
||||
env,
|
||||
|
@ -225,8 +227,6 @@ fn build_eq<'a, 'ctx>(
|
|||
field2_cast.into(),
|
||||
)
|
||||
}
|
||||
|
||||
LayoutRepr::FunctionPointer(_) => todo_lambda_erasure!(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -401,8 +401,8 @@ fn build_neq<'a, 'ctx>(
|
|||
unreachable!("recursion pointers should never be compared directly")
|
||||
}
|
||||
LayoutRepr::LambdaSet(_) => unreachable!("cannot compare closure"),
|
||||
|
||||
LayoutRepr::FunctionPointer(_) => todo_lambda_erasure!(),
|
||||
LayoutRepr::FunctionPointer(_) => unreachable!("cannot compare function pointers"),
|
||||
LayoutRepr::Erased(_) => unreachable!("cannot compare erased types"),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ pub fn basic_type_from_layout<'a, 'ctx>(
|
|||
.as_basic_type_enum(),
|
||||
|
||||
FunctionPointer(_) => todo_lambda_erasure!(),
|
||||
Erased(_) => todo_lambda_erasure!(),
|
||||
|
||||
Builtin(builtin) => basic_type_from_builtin(env, &builtin),
|
||||
}
|
||||
|
|
|
@ -388,6 +388,7 @@ fn build_clone<'a, 'ctx>(
|
|||
)
|
||||
}
|
||||
LayoutRepr::FunctionPointer(_) => todo_lambda_erasure!(),
|
||||
LayoutRepr::Erased(_) => todo_lambda_erasure!(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -626,6 +626,7 @@ fn modify_refcount_layout_build_function<'a, 'ctx>(
|
|||
lambda_set.runtime_representation(),
|
||||
),
|
||||
FunctionPointer(_) => todo_lambda_erasure!(),
|
||||
Erased(_) => todo_lambda_erasure!(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue