Skip to content

Commit

Permalink
Fix all feature errors using unimplemented! and todo! macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Fischman committed Mar 15, 2024
1 parent 5d9b4ff commit be2159e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions brilift/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ fn main() {
bril::Type::Int => bril::Literal::Int(val_str.parse().unwrap()),
bril::Type::Bool => bril::Literal::Bool(val_str == "true"),
bril::Type::Float => bril::Literal::Float(val_str.parse().unwrap()),
bril::Type::Char => bril::Literal::Char(val_str.parse().unwrap()),
bril::Type::Pointer(_) => unimplemented!("pointers not supported as main args"),
})
.collect();
Expand Down
5 changes: 0 additions & 5 deletions brilift/src/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ pub extern "C" fn print_float(f: f64) {
}
}

#[no_mangle]
pub extern "C" fn print_char(c: char) {
print!("{c}");
}

#[no_mangle]
pub extern "C" fn print_sep() {
print!(" ");
Expand Down
7 changes: 5 additions & 2 deletions brilift/src/translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ 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 => rt::print_char 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 Down Expand Up @@ -476,7 +476,8 @@ impl CompileEnv<'_> {
bril::EffectOps::Free => {
let ptr_arg = builder.use_var(self.vars[&args[0]]);
builder.ins().call(self.rt_refs[RTFunc::Free], &[ptr_arg]);
}
},
bril::EffectOps::Speculate | bril::EffectOps::Commit | bril::EffectOps::Guard => unimplemented!(),
},
bril::Instruction::Value {
args,
Expand Down Expand Up @@ -572,6 +573,8 @@ impl CompileEnv<'_> {
let res = builder.ins().iadd(orig_ptr, offset_val);
builder.def_var(self.vars[dest], res);
}
bril::ValueOps::Phi => unimplemented!(),
bril::ValueOps::Ceq | bril::ValueOps::Clt | bril::ValueOps::Cgt | bril::ValueOps::Cle | bril::ValueOps::Cge | bril::ValueOps::Char2int | bril::ValueOps::Int2char => todo!(),
},
}
}
Expand Down

0 comments on commit be2159e

Please sign in to comment.