waffle/src/op_traits.rs

19 lines
564 B
Rust
Raw Normal View History

2021-11-13 03:41:32 -06:00
//! Metadata on operators.
use anyhow::{bail, Result};
use wasmparser::{FuncType, Operator, Type};
pub fn op_inputs(_sigs: &[FuncType], op: &Operator<'_>) -> Result<Vec<Type>> {
match op {
&Operator::Unreachable | &Operator::Nop => Ok(vec![]),
_ => bail!("Unknown operator in op_inputs(): {:?}", op),
}
}
pub fn op_outputs(_sigs: &[FuncType], op: &Operator<'_>) -> Result<Vec<Type>> {
match op {
&Operator::Unreachable | &Operator::Nop => Ok(vec![]),
_ => bail!("Unknown operator in op_outputs(): {:?}", op),
}
}