cranelift_wasm: Use the TableIndex type instead of raw u32

About half of the `FuncEnvironment::translate_table_*` methods were using the
`TableIndex` newtype, while the other half were using raw `u32`s. This commit
makes everything use `TableIndex`.
This commit is contained in:
Nick Fitzgerald
2020-05-20 13:41:34 -07:00
parent 7c68a10ed6
commit 01a92aef95
4 changed files with 20 additions and 16 deletions

View File

@@ -433,7 +433,7 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
fn translate_table_grow(
&mut self,
mut pos: FuncCursor,
_table_index: u32,
_table_index: TableIndex,
_delta: ir::Value,
_init_value: ir::Value,
) -> WasmResult<ir::Value> {
@@ -443,7 +443,7 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
fn translate_table_get(
&mut self,
mut pos: FuncCursor,
_table_index: u32,
_table_index: TableIndex,
_index: ir::Value,
) -> WasmResult<ir::Value> {
Ok(pos.ins().null(self.reference_type()))
@@ -452,7 +452,7 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
fn translate_table_set(
&mut self,
_pos: FuncCursor,
_table_index: u32,
_table_index: TableIndex,
_value: ir::Value,
_index: ir::Value,
) -> WasmResult<()> {
@@ -476,7 +476,7 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
fn translate_table_fill(
&mut self,
_pos: FuncCursor,
_table_index: u32,
_table_index: TableIndex,
_dst: ir::Value,
_val: ir::Value,
_len: ir::Value,