waffle/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! WAFFLE Wasm analysis framework.
//!
//! waffle is a *decompiler and compiler* library for WebAssembly: it
//! defines an SSA-based IR (intermediate representation), with a
//! frontend that translates Wasm to this IR, and a backend that
//! compiles this IR back to Wasm. It can be used by programs that
//! need to transform/modify or add new code to Wasm modules.
//!
//! A good starting point is the `Module`: it can be constructed from
//! Wasm bytecode in memory with `Module::from_wasm_bytes()` and
//! recompiled to Wasm with `Module::to_wasm_bytes()`, after
//! modifications are performed or new code is added. A new module can
//! also be built from scratch with `Module::empty()`.

#![allow(dead_code)]

// Re-export wasmparser for easier use of the right version by our embedders.
pub use wasmparser;
// Likewise for wasm-encoder.
pub use wasm_encoder;

pub mod backend;
pub mod cfg;
pub mod entity;
mod errors;
mod frontend;
mod ir;
pub mod op_traits;
mod ops;
pub mod passes;
pub mod pool;
mod scoped_map;

pub use errors::*;
pub use ir::*;
pub use op_traits::SideEffect;
pub use ops::{Ieee32, Ieee64, MemoryArg, Operator};

mod interp;
pub use interp::*;
pub mod util;

pub use passes::basic_opt::OptOptions;

#[cfg(feature = "fuzzing")]
pub mod fuzzing;

pub mod copying;
mod ssa_traits_impls;