2019-08-02 02:46:35 +00:00
|
|
|
#![deny(
|
|
|
|
dead_code,
|
|
|
|
unused_imports,
|
|
|
|
unused_variables,
|
|
|
|
unused_unsafe,
|
|
|
|
unreachable_patterns
|
|
|
|
)]
|
2019-03-08 23:15:16 +00:00
|
|
|
#![cfg_attr(nightly, feature(unwind_attributes))]
|
|
|
|
|
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;
|
|
|
|
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;
|
|
|
|
use structopt::StructOpt;
|
|
|
|
|
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-04-29 05:13:34 +00:00
|
|
|
code::LLVMModuleCodeGenerator,
|
|
|
|
code::LLVMFunctionCodeGenerator,
|
|
|
|
backend::LLVMBackend,
|
|
|
|
code::CodegenError,
|
|
|
|
>;
|
2019-08-08 23:05:17 +00:00
|
|
|
|
|
|
|
#[derive(Debug, StructOpt, Clone)]
|
|
|
|
/// LLVM backend flags.
|
|
|
|
pub struct CLIOptions {
|
|
|
|
/// Emit LLVM IR before optimization pipeline.
|
|
|
|
#[structopt(long = "backend-llvm-pre-opt-ir", parse(from_os_str))]
|
|
|
|
pre_opt_ir: Option<PathBuf>,
|
|
|
|
|
|
|
|
/// Emit LLVM IR after optimization pipeline.
|
|
|
|
#[structopt(long = "backend-llvm-post-opt-ir", parse(from_os_str))]
|
|
|
|
post_opt_ir: Option<PathBuf>,
|
|
|
|
|
|
|
|
/// Emit LLVM generated native code object file.
|
|
|
|
#[structopt(long = "backend-llvm-object-file", parse(from_os_str))]
|
|
|
|
obj_file: Option<PathBuf>,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub static mut GLOBAL_OPTIONS: CLIOptions = CLIOptions {
|
|
|
|
pre_opt_ir: None,
|
|
|
|
post_opt_ir: None,
|
|
|
|
obj_file: None,
|
|
|
|
};
|