wasmer/lib/llvm-backend/src/lib.rs
Nick Lewycky 31a77b0eb7 Fix llvm backend to work with latest inkwell.
cargo update to pick up latest inkwell branch commit.

Add lifetime annotations to Module which now takes a lifetime, and more lifetime annotations across intrinsics.rs.

Add <'ctx> to missing places in CtxType and Intrinsics. Remove it from reference bindings.

Use ManuallyDrop to ensure that context's members are dropped before the Context.

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-26 19:59:03 -08:00

56 lines
1.4 KiB
Rust

#![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))]
#![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")]
mod backend;
mod code;
mod intrinsics;
mod platform;
mod read_info;
mod stackmap;
mod state;
mod structs;
mod trampolines;
use std::path::PathBuf;
pub use code::LLVMFunctionCodeGenerator as FunctionCodeGenerator;
pub use code::LLVMModuleCodeGenerator as ModuleCodeGenerator;
use wasmer_runtime_core::codegen::SimpleStreamingCompilerGen;
pub type LLVMCompiler = SimpleStreamingCompilerGen<
code::LLVMModuleCodeGenerator<'static>,
code::LLVMFunctionCodeGenerator<'static>,
backend::LLVMBackend,
code::CodegenError,
>;
#[derive(Debug, Clone)]
/// LLVM backend flags.
pub struct LLVMOptions {
/// Emit LLVM IR before optimization pipeline.
pub pre_opt_ir: Option<PathBuf>,
/// Emit LLVM IR after optimization pipeline.
pub post_opt_ir: Option<PathBuf>,
/// Emit LLVM generated native code object file.
pub obj_file: Option<PathBuf>,
}
pub static mut GLOBAL_OPTIONS: LLVMOptions = LLVMOptions {
pre_opt_ir: None,
post_opt_ir: None,
obj_file: None,
};