Rename WasmRuntime's get_name to get_func_name.

This commit is contained in:
Dan Gohman
2017-10-10 10:21:06 -07:00
parent 8e1ba080c0
commit d4c0c5babc
3 changed files with 4 additions and 4 deletions

View File

@@ -152,7 +152,7 @@ pub fn translate_module(
func.signature = runtime func.signature = runtime
.get_signature(runtime.get_func_type(function_index)) .get_signature(runtime.get_func_type(function_index))
.clone(); .clone();
func.name = runtime.get_name(function_index); func.name = runtime.get_func_name(function_index);
trans trans
.translate_from_reader(parser.create_binary_reader(), &mut func, runtime) .translate_from_reader(parser.create_binary_reader(), &mut func, runtime)
.map_err(|e| String::from(e.description()))?; .map_err(|e| String::from(e.description()))?;

View File

@@ -109,7 +109,7 @@ impl FuncEnvironment for DummyRuntime {
// A real implementation would probably add a `vmctx` argument. // A real implementation would probably add a `vmctx` argument.
// And maybe attempt some signature de-duplication. // And maybe attempt some signature de-duplication.
let signature = func.import_signature(self.signatures[sigidx].clone()); let signature = func.import_signature(self.signatures[sigidx].clone());
let name = self.get_name(index); let name = self.get_func_name(index);
func.import_function(ir::ExtFuncData { name, signature }) func.import_function(ir::ExtFuncData { name, signature })
} }
@@ -146,7 +146,7 @@ impl FuncEnvironment for DummyRuntime {
} }
impl WasmRuntime for DummyRuntime { impl WasmRuntime for DummyRuntime {
fn get_name(&self, func_index: FunctionIndex) -> ir::FunctionName { fn get_func_name(&self, func_index: FunctionIndex) -> ir::FunctionName {
ir::FunctionName::new(format!("wasm_0x{:x}", func_index)) ir::FunctionName::new(format!("wasm_0x{:x}", func_index))
} }

View File

@@ -151,7 +151,7 @@ pub trait FuncEnvironment {
/// by the user, they are only for `cretonne-wasm` internal use. /// by the user, they are only for `cretonne-wasm` internal use.
pub trait WasmRuntime: FuncEnvironment { pub trait WasmRuntime: FuncEnvironment {
/// Return the name for the given function index. /// Return the name for the given function index.
fn get_name(&self, func_index: FunctionIndex) -> ir::FunctionName; fn get_func_name(&self, func_index: FunctionIndex) -> ir::FunctionName;
/// Declares a function signature to the runtime. /// Declares a function signature to the runtime.
fn declare_signature(&mut self, sig: &ir::Signature); fn declare_signature(&mut self, sig: &ir::Signature);