Add an index_type field to Table.

This parallels the `index_type` field in `Heap`.
This commit is contained in:
Dan Gohman
2018-08-28 13:57:34 -07:00
parent 0d24641f21
commit 8e2d01a675
9 changed files with 192 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
//! Tables.
use ir::immediates::Imm64;
use ir::GlobalValue;
use ir::{GlobalValue, Type};
use std::fmt;
/// Information about a table declaration.
@@ -19,14 +19,18 @@ pub struct TableData {
/// The size of a table element, in bytes.
pub element_size: Imm64,
/// The index type for the table.
pub index_type: Type,
}
impl fmt::Display for TableData {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("dynamic")?;
write!(
f,
"{}, min {}, bound {}, element_size {}",
self.base_gv, self.min_size, self.bound_gv, self.element_size
" {}, min {}, bound {}, element_size {}, index_type {}",
self.base_gv, self.min_size, self.bound_gv, self.element_size, self.index_type
)
}
}