2019-08-02 02:46:35 +00:00
|
|
|
#![deny(
|
2019-08-16 02:18:29 +00:00
|
|
|
nonstandard_style,
|
2019-08-02 02:46:35 +00:00
|
|
|
unused_imports,
|
2019-08-16 02:18:29 +00:00
|
|
|
unused_mut,
|
2019-08-02 02:46:35 +00:00
|
|
|
unused_variables,
|
|
|
|
unused_unsafe,
|
|
|
|
unreachable_patterns
|
|
|
|
)]
|
2019-08-22 20:32:35 +00:00
|
|
|
#![cfg_attr(not(target_os = "windows"), deny(dead_code))]
|
2019-03-08 23:15:16 +00:00
|
|
|
#![cfg_attr(nightly, feature(unwind_attributes))]
|
2019-09-04 00:06:31 +00: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 23:15:16 +00:00
|
|
|
|
2019-02-26 02:07:22 +00:00
|
|
|
mod backend;
|
2019-02-09 23:53:40 +00:00
|
|
|
mod code;
|
|
|
|
mod intrinsics;
|
2019-03-02 18:56:02 +00:00
|
|
|
mod platform;
|
2019-02-09 23:53:40 +00:00
|
|
|
mod read_info;
|
2019-07-18 18:02:15 +00:00
|
|
|
mod stackmap;
|
2019-02-09 23:53:40 +00:00
|
|
|
mod state;
|
2019-07-30 21:47:53 +00:00
|
|
|
mod structs;
|
2019-03-01 23:48:43 +00:00
|
|
|
mod trampolines;
|
2019-02-09 23:53:40 +00:00
|
|
|
|
2019-08-08 23:05:17 +00:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
2019-07-24 23:04:47 +00:00
|
|
|
pub use code::LLVMFunctionCodeGenerator as FunctionCodeGenerator;
|
|
|
|
pub use code::LLVMModuleCodeGenerator as ModuleCodeGenerator;
|
|
|
|
|
2019-04-29 05:13:34 +00:00
|
|
|
use wasmer_runtime_core::codegen::SimpleStreamingCompilerGen;
|
2019-05-07 04:41:31 +00:00
|
|
|
|
2019-04-30 07:52:43 +00:00
|
|
|
pub type LLVMCompiler = SimpleStreamingCompilerGen<
|
2019-11-05 02:12:32 +00:00
|
|
|
code::LLVMModuleCodeGenerator<'static>,
|
|
|
|
code::LLVMFunctionCodeGenerator<'static>,
|
2019-04-29 05:13:34 +00:00
|
|
|
backend::LLVMBackend,
|
|
|
|
code::CodegenError,
|
|
|
|
>;
|
2019-08-08 23:05:17 +00:00
|
|
|
|
2019-08-09 02:42:41 +00:00
|
|
|
#[derive(Debug, Clone)]
|
2019-08-08 23:05:17 +00:00
|
|
|
/// LLVM backend flags.
|
2019-08-09 02:42:41 +00:00
|
|
|
pub struct LLVMOptions {
|
2019-08-08 23:05:17 +00:00
|
|
|
/// Emit LLVM IR before optimization pipeline.
|
2019-08-09 02:42:41 +00:00
|
|
|
pub pre_opt_ir: Option<PathBuf>,
|
2019-08-08 23:05:17 +00:00
|
|
|
|
|
|
|
/// Emit LLVM IR after optimization pipeline.
|
2019-08-09 02:42:41 +00:00
|
|
|
pub post_opt_ir: Option<PathBuf>,
|
2019-08-08 23:05:17 +00:00
|
|
|
|
|
|
|
/// Emit LLVM generated native code object file.
|
2019-08-09 02:42:41 +00:00
|
|
|
pub obj_file: Option<PathBuf>,
|
2019-08-08 23:05:17 +00:00
|
|
|
}
|
|
|
|
|
2019-08-09 02:42:41 +00:00
|
|
|
pub static mut GLOBAL_OPTIONS: LLVMOptions = LLVMOptions {
|
2019-08-08 23:05:17 +00:00
|
|
|
pre_opt_ir: None,
|
|
|
|
post_opt_ir: None,
|
|
|
|
obj_file: None,
|
|
|
|
};
|