Tidy up handling of the DummyRuntime.
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
//! IL. Can also executes the `start` function of the module by laying out the memories, globals
|
//! IL. Can also executes the `start` function of the module by laying out the memories, globals
|
||||||
//! and tables, then emitting the translated code with hardcoded addresses to memory.
|
//! and tables, then emitting the translated code with hardcoded addresses to memory.
|
||||||
|
|
||||||
use cton_wasm::{translate_module, DummyRuntime, WasmRuntime};
|
use cton_wasm::{translate_module, DummyRuntime};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use cretonne::Context;
|
use cretonne::Context;
|
||||||
use cretonne::settings::FlagsOrIsa;
|
use cretonne::settings::FlagsOrIsa;
|
||||||
@@ -99,10 +99,7 @@ fn handle_module(
|
|||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
let mut dummy_runtime = DummyRuntime::with_flags(fisa.flags.clone());
|
let mut dummy_runtime = DummyRuntime::with_flags(fisa.flags.clone());
|
||||||
let translation = {
|
let translation = translate_module(&data, &mut dummy_runtime)?;
|
||||||
let runtime: &mut WasmRuntime = &mut dummy_runtime;
|
|
||||||
translate_module(&data, runtime)?
|
|
||||||
};
|
|
||||||
terminal.fg(term::color::GREEN).unwrap();
|
terminal.fg(term::color::GREEN).unwrap();
|
||||||
vprintln!(flag_verbose, "ok");
|
vprintln!(flag_verbose, "ok");
|
||||||
terminal.reset().unwrap();
|
terminal.reset().unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user