File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -526,12 +526,15 @@ impl<'a> FunctionTranslator<'a> {
526526 let lhs = self . translate_expr ( lhs_id, decl, decls) ;
527527 let rhs = self . translate_expr ( rhs_id, decl, decls) ;
528528 let t = decl. types [ lhs_id] ;
529- if * t == crate :: types:: Type :: Int32 || * t == crate :: types:: Type :: Bool {
530- self . builder . ins ( ) . icmp ( IntCC :: Equal , lhs, rhs)
531- } else if * t == crate :: types:: Type :: Float32 {
532- self . builder . ins ( ) . fcmp ( FloatCC :: Equal , lhs, rhs)
533- } else {
534- todo ! ( )
529+
530+ match * t {
531+ crate :: types:: Type :: Bool | crate :: types:: Type :: Int32 | crate :: types:: Type :: UInt32 | crate :: types:: Type :: Int8 | crate :: types:: Type :: UInt8 => {
532+ self . builder . ins ( ) . icmp ( IntCC :: Equal , lhs, rhs)
533+ }
534+ crate :: types:: Type :: Float32 | crate :: types:: Type :: Float64 => {
535+ self . builder . ins ( ) . fcmp ( FloatCC :: Equal , lhs, rhs)
536+ }
537+ _ => todo ! ( ) ,
535538 }
536539 }
537540 Binop :: NotEqual => {
You can’t perform that action at this time.
0 commit comments