mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
add pointer Layout
This commit is contained in:
parent
e4566b9757
commit
fbadd9d620
3 changed files with 10 additions and 1 deletions
|
@ -10,7 +10,7 @@ pub fn type_from_layout(cfg: TargetFrontendConfig, layout: &Layout<'_>) -> Type
|
|||
use roc_mono::layout::Layout::*;
|
||||
|
||||
match layout {
|
||||
FunctionPointer(_, _) | Struct(_) | Union(_) => cfg.pointer_type(),
|
||||
FunctionPointer(_, _) | Pointer(_) | Struct(_) | Union(_) => cfg.pointer_type(),
|
||||
Builtin(builtin) => match builtin {
|
||||
Int64 => types::I64,
|
||||
Float64 => types::F64,
|
||||
|
|
|
@ -59,6 +59,9 @@ pub fn basic_type_from_layout<'ctx>(
|
|||
|
||||
ptr_type.as_basic_type_enum()
|
||||
}
|
||||
Pointer(layout) => basic_type_from_layout(arena, context, &layout, ptr_bytes)
|
||||
.ptr_type(AddressSpace::Generic)
|
||||
.into(),
|
||||
Struct(sorted_fields) => {
|
||||
// Determine types
|
||||
let mut field_types = Vec::with_capacity_in(sorted_fields.len(), arena);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue