2019-01-09 06:06:24 +00:00
|
|
|
#[cfg(test)]
|
|
|
|
#[macro_use]
|
|
|
|
extern crate field_offset;
|
|
|
|
|
2019-01-08 17:09:47 +00:00
|
|
|
#[macro_use]
|
|
|
|
mod macros;
|
|
|
|
mod backing;
|
|
|
|
mod instance;
|
2019-01-09 23:31:11 +00:00
|
|
|
mod mmap;
|
2019-01-11 03:59:57 +00:00
|
|
|
mod recovery;
|
|
|
|
mod sig_registry;
|
|
|
|
mod sighandler;
|
2019-01-12 22:52:14 +00:00
|
|
|
pub mod backend;
|
|
|
|
pub mod export;
|
|
|
|
pub mod import;
|
|
|
|
pub mod module;
|
|
|
|
pub mod memory;
|
2019-01-09 06:06:24 +00:00
|
|
|
pub mod table;
|
2019-01-08 17:09:47 +00:00
|
|
|
pub mod types;
|
|
|
|
pub mod vm;
|
|
|
|
pub mod vmcalls;
|
|
|
|
|
2019-01-12 22:52:14 +00:00
|
|
|
pub use self::instance::Instance;
|
2019-01-08 17:09:47 +00:00
|
|
|
|
|
|
|
/// Compile a webassembly module using the provided compiler.
|
2019-01-09 23:31:11 +00:00
|
|
|
pub fn compile(wasm: &[u8], compiler: &dyn backend::Compiler) -> Result<module::Module, String> {
|
2019-01-08 17:09:47 +00:00
|
|
|
compiler.compile(wasm)
|
2019-01-09 02:57:28 +00:00
|
|
|
}
|