Renamed *Defined into *Local for better clarity

This commit is contained in:
Syrus
2020-04-21 23:19:33 -07:00
parent 1ce055cb5a
commit feef35364b
19 changed files with 150 additions and 150 deletions

View File

@@ -7,7 +7,7 @@ use crate::config::LLVMConfig;
use rayon::prelude::{IntoParallelRefIterator, ParallelIterator};
use wasm_common::entity::{EntityRef, PrimaryMap};
use wasm_common::Features;
use wasm_common::{DefinedFuncIndex, FuncIndex, FuncType};
use wasm_common::{LocalFuncIndex, FuncIndex, FuncType};
use wasmer_compiler::FunctionBodyData;
use wasmer_compiler::Module;
use wasmer_compiler::{Compilation, CompileError, CompiledFunction, Compiler};
@@ -54,18 +54,18 @@ impl Compiler for LLVMCompiler {
&self,
module: &Module,
_module_translation: &ModuleTranslationState,
function_body_inputs: PrimaryMap<DefinedFuncIndex, FunctionBodyData<'_>>,
function_body_inputs: PrimaryMap<LocalFuncIndex, FunctionBodyData<'_>>,
) -> Result<Compilation, CompileError> {
let functions = function_body_inputs
.into_iter()
.collect::<Vec<(DefinedFuncIndex, &FunctionBodyData<'_>)>>()
.collect::<Vec<(LocalFuncIndex, &FunctionBodyData<'_>)>>()
.par_iter()
.map_init(FuncTranslator::new, |func_translator, (i, input)| {
func_translator.translate(module, i, input, self.config())
})
.collect::<Result<Vec<_>, CompileError>>()?
.into_iter()
.collect::<PrimaryMap<DefinedFuncIndex, _>>();
.collect::<PrimaryMap<LocalFuncIndex, _>>();
Ok(Compilation::new(functions))
}

View File

@@ -32,7 +32,7 @@ use std::any::Any;
use crate::config::LLVMConfig;
use wasm_common::entity::SecondaryMap;
use wasm_common::{
DefinedFuncIndex, FuncIndex, FuncType, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex,
LocalFuncIndex, FuncIndex, FuncType, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex,
Type,
};
use wasmer_compiler::CompiledFunctionUnwindInfo;
@@ -86,7 +86,7 @@ impl FuncTranslator {
pub fn translate(
&mut self,
wasm_module: &WasmerCompilerModule,
func_index: &DefinedFuncIndex,
func_index: &LocalFuncIndex,
function_body: &FunctionBodyData,
config: &LLVMConfig,
) -> Result<CompiledFunction, CompileError> {