mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 16:44:33 +00:00
reserve tag union as array of bytes in llvm
This commit is contained in:
parent
6ff22de9dd
commit
444e3063e0
1 changed files with 9 additions and 2 deletions
|
@ -68,8 +68,15 @@ pub fn basic_type_from_layout<'ctx>(
|
||||||
.struct_type(field_types.into_bump_slice(), false)
|
.struct_type(field_types.into_bump_slice(), false)
|
||||||
.as_basic_type_enum()
|
.as_basic_type_enum()
|
||||||
}
|
}
|
||||||
Union(_fields) => {
|
Union(fields) => {
|
||||||
panic!("TODO layout_to_basic_type for Tag");
|
// TODO make this dynamic
|
||||||
|
let ptr_size = std::mem::size_of::<i64>();
|
||||||
|
let union_size = layout.stack_size(ptr_size as u32);
|
||||||
|
|
||||||
|
context
|
||||||
|
.i8_type()
|
||||||
|
.array_type(union_size)
|
||||||
|
.as_basic_type_enum()
|
||||||
}
|
}
|
||||||
Pointer(_layout) => {
|
Pointer(_layout) => {
|
||||||
panic!("TODO layout_to_basic_type for Pointer");
|
panic!("TODO layout_to_basic_type for Pointer");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue