wasmer/lib/llvm-backend/src/lib.rs

54 lines
1.2 KiB
Rust
Raw Normal View History

#![deny(
nonstandard_style,
unused_imports,
unused_mut,
unused_variables,
unused_unsafe,
unreachable_patterns
)]
#![cfg_attr(not(target_os = "windows"), deny(dead_code))]
#![cfg_attr(nightly, feature(unwind_attributes))]
mod backend;
2019-02-09 23:53:40 +00:00
mod code;
mod intrinsics;
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;
mod structs;
mod trampolines;
2019-02-09 23:53:40 +00:00
use std::path::PathBuf;
pub use code::LLVMFunctionCodeGenerator as FunctionCodeGenerator;
pub use code::LLVMModuleCodeGenerator as ModuleCodeGenerator;
use wasmer_runtime_core::codegen::SimpleStreamingCompilerGen;
2019-05-07 04:41:31 +00:00
pub type LLVMCompiler = SimpleStreamingCompilerGen<
code::LLVMModuleCodeGenerator,
code::LLVMFunctionCodeGenerator,
backend::LLVMBackend,
code::CodegenError,
>;
2019-08-09 02:42:41 +00:00
#[derive(Debug, Clone)]
/// LLVM backend flags.
2019-08-09 02:42:41 +00:00
pub struct LLVMOptions {
/// Emit LLVM IR before optimization pipeline.
2019-08-09 02:42:41 +00:00
pub pre_opt_ir: Option<PathBuf>,
/// Emit LLVM IR after optimization pipeline.
2019-08-09 02:42:41 +00:00
pub post_opt_ir: Option<PathBuf>,
/// Emit LLVM generated native code object file.
2019-08-09 02:42:41 +00:00
pub obj_file: Option<PathBuf>,
}
2019-08-09 02:42:41 +00:00
pub static mut GLOBAL_OPTIONS: LLVMOptions = LLVMOptions {
pre_opt_ir: None,
post_opt_ir: None,
obj_file: None,
};