This commit is contained in:
Chris Fallin 2021-11-13 00:20:02 -08:00
parent 6bb4f42f6d
commit 8a2e3e5eed

View file

@ -4,6 +4,8 @@ use wasmparser::{FuncType, Type};
pub type SignatureId = usize; pub type SignatureId = usize;
pub type FuncId = usize; pub type FuncId = usize;
pub type BlockId = usize;
pub type InstId = usize;
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct Module { pub struct Module {
@ -14,12 +16,11 @@ pub struct Module {
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub enum FuncDecl { pub enum FuncDecl {
Import(SignatureId), Import(SignatureId),
Body(SignatureId, Function), Body(SignatureId, FunctionBody),
} }
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct Function { pub struct FunctionBody {
pub id: FuncId,
pub signature: SignatureId,
pub locals: Vec<Type>, pub locals: Vec<Type>,
pub blocks: Vec<Block>,
} }