Spill values live across calls.

Calls clobber many registers, so spill everything that is live across a
call for now.

In the future, we may add support for callee-saved registers.
This commit is contained in:
Jakob Stoklund Olesen
2017-06-14 08:55:01 -07:00
parent 5a23f975fc
commit f2f162f37e
3 changed files with 33 additions and 1 deletions

View File

@@ -64,6 +64,14 @@ impl Affinity {
}
}
/// Is this the `Reg` affinity?
pub fn is_reg(self) -> bool {
match self {
Affinity::Reg(_) => true,
_ => false,
}
}
/// Is this the `Stack` affinity?
pub fn is_stack(self) -> bool {
match self {