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

@@ -347,7 +347,7 @@ pub trait FuncEnvironment: TargetEnvironment {
fn translate_table_grow(
&mut self,
pos: FuncCursor,
table_index: u32,
table_index: TableIndex,
delta: ir::Value,
init_value: ir::Value,
) -> WasmResult<ir::Value>;
@@ -356,7 +356,7 @@ pub trait FuncEnvironment: TargetEnvironment {
fn translate_table_get(
&mut self,
pos: FuncCursor,
table_index: u32,
table_index: TableIndex,
index: ir::Value,
) -> WasmResult<ir::Value>;
@@ -364,7 +364,7 @@ pub trait FuncEnvironment: TargetEnvironment {
fn translate_table_set(
&mut self,
pos: FuncCursor,
table_index: u32,
table_index: TableIndex,
value: ir::Value,
index: ir::Value,
) -> WasmResult<()>;
@@ -387,7 +387,7 @@ pub trait FuncEnvironment: TargetEnvironment {
fn translate_table_fill(
&mut self,
pos: FuncCursor,
table_index: u32,
table_index: TableIndex,
dst: ir::Value,
val: ir::Value,
len: ir::Value,