Skip to content

Commit

Permalink
Remove PrintChar and ParseChar
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Fischman committed Mar 17, 2024
1 parent 1a5f124 commit 19e1b5b
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions brilift/src/translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ enum RTFunc {
PrintInt,
PrintBool,
PrintFloat,
PrintChar,
PrintSep,
PrintEnd,
Alloc,
Expand Down Expand Up @@ -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![],
Expand Down Expand Up @@ -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",
Expand All @@ -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,
Expand All @@ -117,7 +109,6 @@ enum RTSetupFunc {
ParseInt,
ParseBool,
ParseFloat,
ParseChar,
}

impl RTSetupFunc {
Expand Down Expand Up @@ -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,
},
}
}

Expand All @@ -167,7 +150,6 @@ impl RTSetupFunc {
Self::ParseInt => "_bril_parse_int",
Self::ParseBool => "_bril_parse_bool",
Self::ParseFloat => "_bril_parse_float",
Self::ParseChar => todo!(),
}
}
}
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -828,7 +810,7 @@ impl<M: Module> Translator<M> {
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]
Expand Down

0 comments on commit 19e1b5b

Please sign in to comment.