Renamed FuncType to FunctionType

This commit is contained in:
Syrus
2020-05-04 13:34:05 -07:00
parent 447939497c
commit 2997be7d88
20 changed files with 63 additions and 61 deletions

View File

@@ -9,7 +9,7 @@ use crate::target::Target;
use crate::FunctionBodyData;
use crate::ModuleTranslationState;
use wasm_common::entity::PrimaryMap;
use wasm_common::{Features, FuncType, LocalFuncIndex, MemoryIndex, TableIndex};
use wasm_common::{Features, FunctionType, LocalFuncIndex, MemoryIndex, TableIndex};
use wasmer_runtime::Module;
use wasmer_runtime::{MemoryPlan, TablePlan};
use wasmparser::{validate, OperatorValidatorConfig, ValidatingParserConfig};
@@ -82,6 +82,6 @@ pub trait Compiler {
/// ```
fn compile_wasm_trampolines(
&self,
signatures: &[FuncType],
signatures: &[FunctionType],
) -> Result<Vec<FunctionBody>, CompileError>;
}

View File

@@ -7,7 +7,7 @@ use crate::{WasmError, WasmResult};
use std::convert::TryFrom;
use std::sync::Arc;
use wasm_common::entity::PrimaryMap;
use wasm_common::FuncType;
use wasm_common::FunctionType;
use wasm_common::{
DataIndex, DataInitializer, DataInitializerLocation, ElemIndex, ExportIndex, FuncIndex,
GlobalIndex, GlobalInit, GlobalType, ImportIndex, LocalFuncIndex, MemoryIndex, MemoryType,
@@ -102,7 +102,7 @@ impl<'data> ModuleEnvironment<'data> {
Ok(())
}
pub(crate) fn declare_signature(&mut self, sig: FuncType) -> WasmResult<()> {
pub(crate) fn declare_signature(&mut self, sig: FunctionType) -> WasmResult<()> {
// TODO: Deduplicate signatures.
self.result.module.signatures.push(sig);
Ok(())

View File

@@ -18,15 +18,16 @@ use std::vec::Vec;
use wasm_common::entity::packed_option::ReservedValue;
use wasm_common::entity::EntityRef;
use wasm_common::{
DataIndex, ElemIndex, FuncIndex, FuncType, GlobalIndex, GlobalInit, GlobalType, MemoryIndex,
MemoryType, Pages, SignatureIndex, TableIndex, TableType, Type, V128,
DataIndex, ElemIndex, FuncIndex, FunctionType, GlobalIndex, GlobalInit, GlobalType,
MemoryIndex, MemoryType, Pages, SignatureIndex, TableIndex, TableType, Type, V128,
};
use wasmparser::{
self, CodeSectionReader, Data, DataKind, DataSectionReader, Element, ElementItem, ElementItems,
ElementKind, ElementSectionReader, Export, ExportSectionReader, ExternalKind,
FuncType as WPFuncType, FunctionSectionReader, GlobalSectionReader, GlobalType as WPGlobalType,
ImportSectionEntryType, ImportSectionReader, MemorySectionReader, MemoryType as WPMemoryType,
NameSectionReader, Naming, NamingReader, Operator, TableSectionReader, TypeSectionReader,
FuncType as WPFunctionType, FunctionSectionReader, GlobalSectionReader,
GlobalType as WPGlobalType, ImportSectionEntryType, ImportSectionReader, MemorySectionReader,
MemoryType as WPMemoryType, NameSectionReader, Naming, NamingReader, Operator,
TableSectionReader, TypeSectionReader,
};
/// Helper function translating wasmparser types to Wasm Type.
@@ -57,7 +58,7 @@ pub fn parse_type_section(
for entry in types {
match entry.map_err(to_wasm_error)? {
WPFuncType {
WPFunctionType {
form: wasmparser::Type::Func,
params,
returns,
@@ -76,7 +77,7 @@ pub fn parse_type_section(
.expect("only numeric types are supported in function signatures")
})
.collect();
let sig = FuncType::new(sig_params, sig_returns);
let sig = FunctionType::new(sig_params, sig_returns);
environ.declare_signature(sig)?;
module_translation_state.wasm_types.push((params, returns));
}