Minor code simplification.

This commit is contained in:
Dan Gohman
2018-08-28 16:30:51 -07:00
parent c23bfdaa91
commit 0842825c38

View File

@@ -16,7 +16,6 @@ use translation_utils::{
DefinedFuncIndex, FuncIndex, Global, GlobalIndex, Memory, MemoryIndex, SignatureIndex, Table, DefinedFuncIndex, FuncIndex, Global, GlobalIndex, Memory, MemoryIndex, SignatureIndex, Table,
TableIndex, TableIndex,
}; };
use wasmparser;
/// Compute a `ir::ExternalName` for a given wasm function index. /// Compute a `ir::ExternalName` for a given wasm function index.
fn get_func_name(func_index: FuncIndex) -> ir::ExternalName { fn get_func_name(func_index: FuncIndex) -> ir::ExternalName {
@@ -438,9 +437,8 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
let name = get_func_name(func_index); let name = get_func_name(func_index);
let sig = func_environ.vmctx_sig(self.get_func_type(func_index)); let sig = func_environ.vmctx_sig(self.get_func_type(func_index));
let mut func = ir::Function::with_name_signature(name, sig); let mut func = ir::Function::with_name_signature(name, sig);
let reader = wasmparser::BinaryReader::new(body_bytes);
self.trans self.trans
.translate_from_reader(reader, &mut func, &mut func_environ)?; .translate(body_bytes, &mut func, &mut func_environ)?;
func func
}; };
self.func_bytecode_sizes.push(body_bytes.len()); self.func_bytecode_sizes.push(body_bytes.len());