Write and parse value locations for EBB arguments

Fixes #56.

We now have complete support for value location annotations in the
textual IL format. Values defined by instructions as well as EBB
arguments are covered.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-15 11:21:29 -07:00
parent 24a5a02752
commit cc3707706c
6 changed files with 52 additions and 16 deletions

View File

@@ -25,6 +25,14 @@ impl Default for ValueLoc {
}
impl ValueLoc {
/// Is this an assigned location? (That is, not `Unassigned`).
pub fn is_assigned(&self) -> bool {
match *self {
ValueLoc::Unassigned => false,
_ => true,
}
}
/// Get the register unit of this location, or panic.
pub fn unwrap_reg(self) -> RegUnit {
match self {