Make ModuleEnvironment's target_config() return by value.

This makes it more consistent with the other target_config() functions
which were all changed to return by value.
This commit is contained in:
Dan Gohman
2018-11-19 07:05:05 -06:00
parent 367f3cd5d3
commit f6a6ce3199
2 changed files with 3 additions and 3 deletions

View File

@@ -338,8 +338,8 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
} }
impl<'data> ModuleEnvironment<'data> for DummyEnvironment { impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
fn target_config(&self) -> &TargetFrontendConfig { fn target_config(&self) -> TargetFrontendConfig {
&self.info.config self.info.config
} }
fn get_func_name(&self, func_index: FuncIndex) -> ir::ExternalName { fn get_func_name(&self, func_index: FuncIndex) -> ir::ExternalName {

View File

@@ -237,7 +237,7 @@ pub trait FuncEnvironment {
/// by the user, they are only for `cranelift-wasm` internal use. /// by the user, they are only for `cranelift-wasm` internal use.
pub trait ModuleEnvironment<'data> { pub trait ModuleEnvironment<'data> {
/// Get the information needed to produce Cranelift IR for the current target. /// Get the information needed to produce Cranelift IR for the current target.
fn target_config(&self) -> &TargetFrontendConfig; fn target_config(&self) -> TargetFrontendConfig;
/// Return the name for the given function index. /// Return the name for the given function index.
fn get_func_name(&self, func_index: FuncIndex) -> ir::ExternalName; fn get_func_name(&self, func_index: FuncIndex) -> ir::ExternalName;