Add tests

This commit is contained in:
Jeehoon Kang
2020-06-09 14:45:11 +00:00
parent ea97330e03
commit ea9e6afcf8
258 changed files with 149921 additions and 26 deletions

View File

@@ -423,6 +423,14 @@ impl RegisterId {
pub fn temp(bid: BlockId, iid: usize) -> Self {
Self::Temp { bid, iid }
}
pub fn is_const(&self, bid_init: BlockId) -> bool {
match self {
Self::Local { .. } => true,
Self::Arg { bid, .. } => bid == &bid_init,
_ => false,
}
}
}
impl fmt::Display for RegisterId {