save-raw option

This commit is contained in:
NikVolf
2017-12-27 12:35:31 +03:00
parent f146187e00
commit bf90913055
+9
View File
@@ -94,6 +94,10 @@ fn main() {
.help("Final wasm binary name")
.takes_value(true)
.long("final"))
.arg(Arg::with_name("save_raw")
.help("Save intermediate raw bytecode to path")
.takes_value(true)
.long("save-raw"))
.get_matches();
let target_dir = matches.value_of("target").expect("is required; qed");
@@ -140,6 +144,11 @@ fn main() {
wasm_utils::optimize(&mut module, vec![CALL_SYMBOL]).expect("Optimizer to finish without errors");
}
if let Some(save_raw_path) = matches.value_of("save_raw") {
parity_wasm::serialize_to_file(save_raw_path, module.clone())
.expect("Failed to write intermediate module");
}
let raw_module = parity_wasm::serialize(module).expect("Failed to serialize module");
// If module has an exported function with name=CREATE_SYMBOL