From 19e1b5bf5aacaca60298d46c9fbd0d6eb6601dd6 Mon Sep 17 00:00:00 2001 From: Alex Fischman Date: Sat, 16 Mar 2024 19:21:48 -0700 Subject: [PATCH] Remove PrintChar and ParseChar --- brilift/src/translator.rs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/brilift/src/translator.rs b/brilift/src/translator.rs index 2db265a5..79de4f40 100644 --- a/brilift/src/translator.rs +++ b/brilift/src/translator.rs @@ -22,7 +22,6 @@ enum RTFunc { PrintInt, PrintBool, PrintFloat, - PrintChar, PrintSep, PrintEnd, Alloc, @@ -51,11 +50,6 @@ impl RTFunc { returns: vec![], call_conv, }, - Self::PrintChar => ir::Signature { - params: vec![ir::AbiParam::new(ir::types::I32)], - returns: vec![], - call_conv, - }, Self::PrintSep => ir::Signature { params: vec![], returns: vec![], @@ -87,7 +81,6 @@ impl RTFunc { Self::PrintInt => "_bril_print_int", Self::PrintBool => "_bril_print_bool", Self::PrintFloat => "_bril_print_float", - Self::PrintChar => todo!(), Self::PrintSep => "_bril_print_sep", Self::PrintEnd => "_bril_print_end", Self::Alloc => "_bril_alloc", @@ -100,7 +93,6 @@ impl RTFunc { RTFunc::PrintInt => rt::print_int as *const u8, RTFunc::PrintBool => rt::print_bool as *const u8, RTFunc::PrintFloat => rt::print_float as *const u8, - RTFunc::PrintChar => todo!(), RTFunc::PrintSep => rt::print_sep as *const u8, RTFunc::PrintEnd => rt::print_end as *const u8, RTFunc::Alloc => rt::mem_alloc as *const u8, @@ -117,7 +109,6 @@ enum RTSetupFunc { ParseInt, ParseBool, ParseFloat, - ParseChar, } impl RTSetupFunc { @@ -151,14 +142,6 @@ impl RTSetupFunc { returns: vec![ir::AbiParam::new(ir::types::F64)], call_conv, }, - Self::ParseChar => ir::Signature { - params: vec![ - ir::AbiParam::new(pointer_type), - ir::AbiParam::new(ir::types::I64), - ], - returns: vec![ir::AbiParam::new(ir::types::I32)], - call_conv, - }, } } @@ -167,7 +150,6 @@ impl RTSetupFunc { Self::ParseInt => "_bril_parse_int", Self::ParseBool => "_bril_parse_bool", Self::ParseFloat => "_bril_parse_float", - Self::ParseChar => todo!(), } } } @@ -329,7 +311,7 @@ impl CompileEnv<'_> { bril::Type::Int => RTFunc::PrintInt, bril::Type::Bool => RTFunc::PrintBool, bril::Type::Float => RTFunc::PrintFloat, - bril::Type::Char => RTFunc::PrintChar, + bril::Type::Char => todo!(), bril::Type::Pointer(_) => todo!(), }; let print_ref = self.rt_refs[print_func]; @@ -828,7 +810,7 @@ impl Translator { bril::Type::Int => RTSetupFunc::ParseInt, bril::Type::Bool => RTSetupFunc::ParseBool, bril::Type::Float => RTSetupFunc::ParseFloat, - bril::Type::Char => RTSetupFunc::ParseChar, + bril::Type::Char => todo!(), bril::Type::Pointer(_) => unimplemented!("can't print pointers"), }]; let idx_arg = builder.ins().iconst(ir::types::I64, (i + 1) as i64); // skip argv[0]