872: Pass llvm debug flags to the llvm backend. r=nlewycky a=nlewycky

This was accidentally removed in 124ad73e8ae2c6864bad3ebe5572d79736cfd688 .

Co-authored-by: Nick Lewycky <nick@wasmer.io>
This commit is contained in:
bors[bot] 2019-10-08 19:30:46 +00:00 committed by GitHub
commit e6693612f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ use structopt::StructOpt;
use wasmer::*;
use wasmer_clif_backend::CraneliftCompiler;
#[cfg(feature = "backend-llvm")]
use wasmer_llvm_backend::LLVMCompiler;
use wasmer_llvm_backend::{LLVMCompiler, LLVMOptions};
use wasmer_runtime::{
cache::{Cache as BaseCache, FileSystemCache, WasmHash},
Func, Value, VERSION,
@ -109,7 +109,7 @@ pub struct LLVMCLIOptions {
post_opt_ir: Option<PathBuf>,
/// Emit LLVM generated native code object file.
#[structopt(long = "backend-llvm-object-file", parse(from_os_str))]
#[structopt(long = "llvm-object-file", parse(from_os_str))]
obj_file: Option<PathBuf>,
}
@ -405,6 +405,20 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
None => return Err("the requested backend is not enabled".into()),
};
#[cfg(feature = "backend-llvm")]
{
if options.backend == Backend::LLVM {
let options = options.backend_llvm_options.clone();
unsafe {
wasmer_llvm_backend::GLOBAL_OPTIONS = LLVMOptions {
pre_opt_ir: options.pre_opt_ir,
post_opt_ir: options.post_opt_ir,
obj_file: options.obj_file,
}
}
}
}
let track_state = !options.no_track_state;
#[cfg(feature = "loader-kernel")]