mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34: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)
|
||||
.as_basic_type_enum()
|
||||
}
|
||||
Union(_fields) => {
|
||||
panic!("TODO layout_to_basic_type for Tag");
|
||||
Union(fields) => {
|
||||
// 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) => {
|
||||
panic!("TODO layout_to_basic_type for Pointer");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue