2019-08-01 20:46:35 -06:00
|
|
|
#![deny(
|
2019-08-15 20:18:29 -06:00
|
|
|
nonstandard_style,
|
2019-08-01 20:46:35 -06:00
|
|
|
unused_imports,
|
2019-08-15 20:18:29 -06:00
|
|
|
unused_mut,
|
2019-08-01 20:46:35 -06:00
|
|
|
unused_variables,
|
|
|
|
unused_unsafe,
|
|
|
|
unreachable_patterns
|
|
|
|
)]
|
2019-12-06 12:06:18 -08:00
|
|
|
#![cfg_attr(
|
|
|
|
all(not(target_os = "windows"), not(target_arch = "aarch64")),
|
|
|
|
deny(dead_code)
|
|
|
|
)]
|
2019-03-08 15:15:16 -08:00
|
|
|
#![cfg_attr(nightly, feature(unwind_attributes))]
|
2019-09-03 17:06:31 -07:00
|
|
|
#![doc(html_favicon_url = "https://wasmer.io/static/icons/favicon.ico")]
|
|
|
|
#![doc(html_logo_url = "https://avatars3.githubusercontent.com/u/44205449?s=200&v=4")]
|
2019-03-08 15:15:16 -08:00
|
|
|
|
2019-02-25 18:07:22 -08:00
|
|
|
mod backend;
|
2019-02-09 15:53:40 -08:00
|
|
|
mod code;
|
|
|
|
mod intrinsics;
|
2019-03-02 10:56:02 -08:00
|
|
|
mod platform;
|
2019-02-09 15:53:40 -08:00
|
|
|
mod read_info;
|
2019-07-19 02:02:15 +08:00
|
|
|
mod stackmap;
|
2019-02-09 15:53:40 -08:00
|
|
|
mod state;
|
2019-07-30 14:47:53 -07:00
|
|
|
mod structs;
|
2019-03-01 15:48:43 -08:00
|
|
|
mod trampolines;
|
2019-02-09 15:53:40 -08:00
|
|
|
|
2019-07-24 16:04:47 -07:00
|
|
|
pub use code::LLVMFunctionCodeGenerator as FunctionCodeGenerator;
|
|
|
|
pub use code::LLVMModuleCodeGenerator as ModuleCodeGenerator;
|
|
|
|
|
2019-04-29 00:13:34 -05:00
|
|
|
use wasmer_runtime_core::codegen::SimpleStreamingCompilerGen;
|
2019-05-06 23:41:31 -05:00
|
|
|
|
2019-04-30 15:52:43 +08:00
|
|
|
pub type LLVMCompiler = SimpleStreamingCompilerGen<
|
2019-11-04 18:12:32 -08:00
|
|
|
code::LLVMModuleCodeGenerator<'static>,
|
|
|
|
code::LLVMFunctionCodeGenerator<'static>,
|
2019-04-29 00:13:34 -05:00
|
|
|
backend::LLVMBackend,
|
|
|
|
code::CodegenError,
|
|
|
|
>;
|
2019-08-08 16:05:17 -07:00
|
|
|
|
2019-12-04 10:38:28 -08:00
|
|
|
pub type InkwellModule<'ctx> = inkwell::module::Module<'ctx>;
|
|
|
|
pub type InkwellMemoryBuffer = inkwell::memory_buffer::MemoryBuffer;
|
2019-08-08 16:05:17 -07:00
|
|
|
|
2019-12-04 10:38:28 -08:00
|
|
|
pub trait LLVMCallbacks: std::any::Any + 'static {
|
2019-12-06 12:09:34 -08:00
|
|
|
fn preopt_ir_callback(&mut self, _module: &InkwellModule) {}
|
|
|
|
fn postopt_ir_callback(&mut self, _module: &InkwellModule) {}
|
|
|
|
fn obj_memory_buffer_callback(&mut self, _memory_buffer: &InkwellMemoryBuffer) {}
|
2019-08-08 16:05:17 -07:00
|
|
|
}
|
|
|
|
|
2019-12-04 10:38:28 -08:00
|
|
|
pub struct LLVMBackendConfig {
|
|
|
|
pub callbacks: Option<std::rc::Rc<std::cell::RefCell<dyn LLVMCallbacks>>>,
|
|
|
|
}
|