rename PassiveElemIndex to ElemIndex and same for PassiveDataIndex (#1188)

* rename PassiveElemIndex to ElemIndex and same for PassiveDataIndex (#1411)

* rename PassiveDataIndex to DataIndex

* rename PassiveElemIndex to ElemIndex

* Apply renamings to wasmtime as well

* Run rustfmt

Co-authored-by: csmoe <csmoe@msn.com>
This commit is contained in:
Alex Crichton
2020-03-02 08:55:25 -06:00
committed by GitHub
parent 2c5be49af0
commit 8597930eed
10 changed files with 37 additions and 42 deletions

View File

@@ -5,8 +5,8 @@ use crate::WASM_MAX_PAGES;
use cranelift_codegen::ir;
use cranelift_entity::{EntityRef, PrimaryMap};
use cranelift_wasm::{
DefinedFuncIndex, DefinedGlobalIndex, DefinedMemoryIndex, DefinedTableIndex, FuncIndex, Global,
GlobalIndex, Memory, MemoryIndex, PassiveElemIndex, SignatureIndex, Table, TableIndex,
DefinedFuncIndex, DefinedGlobalIndex, DefinedMemoryIndex, DefinedTableIndex, ElemIndex,
FuncIndex, Global, GlobalIndex, Memory, MemoryIndex, SignatureIndex, Table, TableIndex,
};
use indexmap::IndexMap;
use more_asserts::assert_ge;
@@ -166,7 +166,7 @@ pub struct Module {
pub table_elements: Vec<TableElements>,
/// WebAssembly passive elements.
pub passive_elements: HashMap<PassiveElemIndex, Box<[FuncIndex]>>,
pub passive_elements: HashMap<ElemIndex, Box<[FuncIndex]>>,
/// WebAssembly table initializers.
pub func_names: HashMap<FuncIndex, String>,
@@ -239,7 +239,7 @@ impl Module {
}
/// Get the given passive element, if it exists.
pub fn get_passive_element(&self, index: PassiveElemIndex) -> Option<&[FuncIndex]> {
pub fn get_passive_element(&self, index: ElemIndex) -> Option<&[FuncIndex]> {
self.passive_elements.get(&index).map(|es| &**es)
}
}