Revert "remove Term"
This reverts commit 3b5879841aedecba5057c70c71da0ba23e5cd84a.
This commit is contained in:
@@ -88,10 +88,7 @@ pub enum VarAlloc {
|
||||
safety: VarSafetyStatus,
|
||||
to_perm_var_num: Option<usize>,
|
||||
},
|
||||
Perm {
|
||||
reg: usize,
|
||||
allocation: PermVarAllocation,
|
||||
}, // stack offset, allocation info
|
||||
Perm(usize, PermVarAllocation), // stack offset, allocation info
|
||||
}
|
||||
|
||||
impl VarAlloc {
|
||||
@@ -99,14 +96,14 @@ impl VarAlloc {
|
||||
pub(crate) fn as_reg_type(&self) -> RegType {
|
||||
match *self {
|
||||
VarAlloc::Temp { temp_reg, .. } => RegType::Temp(temp_reg),
|
||||
VarAlloc::Perm { reg, .. } => RegType::Perm(reg),
|
||||
VarAlloc::Perm(r, _) => RegType::Perm(r),
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn set_register(&mut self, reg_num: usize) {
|
||||
match self {
|
||||
VarAlloc::Perm { ref mut reg, .. } => *reg = reg_num,
|
||||
VarAlloc::Perm(ref mut p, _) => *p = reg_num,
|
||||
VarAlloc::Temp {
|
||||
ref mut temp_reg, ..
|
||||
} => *temp_reg = reg_num,
|
||||
@@ -155,10 +152,7 @@ pub struct VariableRecord {
|
||||
impl Default for VariableRecord {
|
||||
fn default() -> Self {
|
||||
VariableRecord {
|
||||
allocation: VarAlloc::Perm {
|
||||
reg: 0,
|
||||
allocation: PermVarAllocation::Pending,
|
||||
},
|
||||
allocation: VarAlloc::Perm(0, PermVarAllocation::Pending),
|
||||
num_occurrences: 0,
|
||||
running_count: 0,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user