Rename FunctionName to ExternalName.
This commit is contained in:
@@ -9,9 +9,9 @@ use cretonne::settings;
|
||||
use wasmparser;
|
||||
use std::error::Error;
|
||||
|
||||
/// Compute a `ir::FunctionName` for a given wasm function index.
|
||||
fn get_func_name(func_index: FunctionIndex) -> ir::FunctionName {
|
||||
ir::FunctionName::new(format!("wasm_0x{:x}", func_index))
|
||||
/// Compute a `ir::ExternalName` for a given wasm function index.
|
||||
fn get_func_name(func_index: FunctionIndex) -> ir::ExternalName {
|
||||
ir::ExternalName::new(format!("wasm_0x{:x}", func_index))
|
||||
}
|
||||
|
||||
/// A collection of names under which a given entity is exported.
|
||||
@@ -196,7 +196,7 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
|
||||
}
|
||||
|
||||
impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
fn get_func_name(&self, func_index: FunctionIndex) -> ir::FunctionName {
|
||||
fn get_func_name(&self, func_index: FunctionIndex) -> ir::ExternalName {
|
||||
get_func_name(func_index)
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ pub trait FuncEnvironment {
|
||||
/// by the user, they are only for `cretonne-wasm` internal use.
|
||||
pub trait ModuleEnvironment<'data> {
|
||||
/// Return the name for the given function index.
|
||||
fn get_func_name(&self, func_index: FunctionIndex) -> ir::FunctionName;
|
||||
fn get_func_name(&self, func_index: FunctionIndex) -> ir::ExternalName;
|
||||
|
||||
/// Declares a function signature to the environment.
|
||||
fn declare_signature(&mut self, sig: &ir::Signature);
|
||||
|
||||
@@ -255,7 +255,7 @@ mod tests {
|
||||
let runtime = DummyEnvironment::default();
|
||||
let mut ctx = Context::new();
|
||||
|
||||
ctx.func.name = ir::FunctionName::new("small1");
|
||||
ctx.func.name = ir::ExternalName::new("small1");
|
||||
ctx.func.signature.params.push(ir::AbiParam::new(I32));
|
||||
ctx.func.signature.returns.push(ir::AbiParam::new(I32));
|
||||
|
||||
@@ -286,7 +286,7 @@ mod tests {
|
||||
let runtime = DummyEnvironment::default();
|
||||
let mut ctx = Context::new();
|
||||
|
||||
ctx.func.name = ir::FunctionName::new("small2");
|
||||
ctx.func.name = ir::ExternalName::new("small2");
|
||||
ctx.func.signature.params.push(ir::AbiParam::new(I32));
|
||||
ctx.func.signature.returns.push(ir::AbiParam::new(I32));
|
||||
|
||||
@@ -326,7 +326,7 @@ mod tests {
|
||||
let runtime = DummyEnvironment::default();
|
||||
let mut ctx = Context::new();
|
||||
|
||||
ctx.func.name = ir::FunctionName::new("infloop");
|
||||
ctx.func.name = ir::ExternalName::new("infloop");
|
||||
ctx.func.signature.returns.push(ir::AbiParam::new(I32));
|
||||
|
||||
trans
|
||||
|
||||
Reference in New Issue
Block a user