mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
Fix to_cc_type a bit
This commit is contained in:
parent
54c4ddd700
commit
c5ec8aba4f
1 changed files with 11 additions and 1 deletions
|
@ -5910,8 +5910,18 @@ fn to_cc_type<'a, 'ctx>(
|
|||
layout_interner: &STLayoutInterner<'a>,
|
||||
layout: InLayout<'a>,
|
||||
) -> BasicTypeEnum<'ctx> {
|
||||
match layout_interner.runtime_representation(layout) {
|
||||
let layout_repr = layout_interner.runtime_representation(layout);
|
||||
match layout_repr {
|
||||
LayoutRepr::Builtin(builtin) => to_cc_type_builtin(env, &builtin),
|
||||
LayoutRepr::Struct(_) => {
|
||||
let stack_type = basic_type_from_layout(env, layout_interner, layout_repr);
|
||||
|
||||
if layout_repr.is_passed_by_reference(layout_interner) {
|
||||
stack_type.ptr_type(AddressSpace::default()).into()
|
||||
} else {
|
||||
stack_type
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
// TODO this is almost certainly incorrect for bigger structs
|
||||
basic_type_from_layout(env, layout_interner, layout_interner.get_repr(layout))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue