Revert "remove Term"

This reverts commit 3b5879841aedecba5057c70c71da0ba23e5cd84a.
This commit is contained in:
Mark Thom
2025-03-15 13:19:26 -07:00
committed by Mark Thom
parent eef7b06919
commit 9e1e99f961
53 changed files with 3726 additions and 4517 deletions

View File

@@ -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,
}