mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
simplify Byte layout
This commit is contained in:
parent
c11f374eb0
commit
0996f264e7
8 changed files with 19 additions and 41 deletions
|
@ -633,7 +633,7 @@ fn build_switch<'a, 'ctx, 'env>(
|
|||
let int_val = match cond_layout {
|
||||
Layout::Builtin(Builtin::Int64) => context.i64_type().const_int(*int as u64, false),
|
||||
Layout::Builtin(Builtin::Bool) => context.bool_type().const_int(*int as u64, false),
|
||||
Layout::Builtin(Builtin::Byte(_)) => context.i8_type().const_int(*int as u64, false),
|
||||
Layout::Builtin(Builtin::Byte) => context.i8_type().const_int(*int as u64, false),
|
||||
_ => panic!("Can't cast to cond_layout = {:?}", cond_layout),
|
||||
};
|
||||
let block = context.append_basic_block(parent, format!("branch{}", int).as_str());
|
||||
|
|
|
@ -99,7 +99,7 @@ pub fn basic_type_from_layout<'ctx>(
|
|||
Int64 => context.i64_type().as_basic_type_enum(),
|
||||
Float64 => context.f64_type().as_basic_type_enum(),
|
||||
Bool => context.bool_type().as_basic_type_enum(),
|
||||
Byte(_) => context.i8_type().as_basic_type_enum(),
|
||||
Byte => context.i8_type().as_basic_type_enum(),
|
||||
Str | EmptyStr => context
|
||||
.i8_type()
|
||||
.ptr_type(AddressSpace::Generic)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue