Replace cretonne-wasm's Local with cretonne-frontend's Variable.

Previously, cretonne-wasm used its own Local struct for identifying
local variables. However, now that cretonne-frontend provides a
Variable struct, just use that instead.
This commit is contained in:
Dan Gohman
2018-03-12 10:28:25 -07:00
parent b8a106adf0
commit ad363d7e6b
4 changed files with 28 additions and 38 deletions

View File

@@ -12,6 +12,14 @@ use std::u32;
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct Variable(u32);
impl Variable {
/// Create a new Variable with the given index.
pub fn with_u32(index: u32) -> Self {
assert!(index < u32::MAX);
Variable(index)
}
}
impl EntityRef for Variable {
fn new(index: usize) -> Self {
assert!(index < (u32::MAX as usize));