Skip to content

Commit

Permalink
chore: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat committed Oct 17, 2023
1 parent a751d1c commit 9ebda1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
6 changes: 0 additions & 6 deletions frontend-wasm/src/func_translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ impl FuncTranslator {
func_validator: &mut FuncValidator<impl WasmModuleResources>,
) -> WasmResult<()> {
let mut reader = body.get_binary_reader();
// log::trace!(
// "translate({} bytes, {}{:?})",
// reader.bytes_remaining(),
// func.signature.name,
// func.signature
// );

let mut builder = FunctionBuilderExt::new(mod_func_builder, &mut self.func_ctx);
let entry_block = builder.current_block();
Expand Down
16 changes: 9 additions & 7 deletions frontend-wasm/src/translation_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ pub fn emit_zero(ty: &Type, builder: &mut FunctionBuilderExt) -> Value {
Type::U128 => todo!(),
Type::F64 => builder.ins().f64(0.0, SourceSpan::default()),
Type::Felt => todo!(),
Type::Ptr(_) => panic!("cannot emit zero for pointer type"),
Type::Struct(_) => panic!("cannot emit zero for struct type"),
Type::Array(_, _) => panic!("cannot emit zero for array type"),
Type::Unknown => panic!("cannot emit zero for unknown type"),
Type::Unit => panic!("cannot emit zero for unit type"),
Type::Never => panic!("cannot emit zero for never type"),
Type::NativePtr(_, _) => todo!(),
Type::Ptr(_)
| Type::NativePtr(_, _)
| Type::Struct(_)
| Type::Array(_, _)
| Type::Unknown
| Type::Unit
| Type::Never => {
panic!("cannot emit zero for type: {:?}", ty);
}
}
}

Expand Down

0 comments on commit 9ebda1b

Please sign in to comment.