Resolve lints and format
This commit is contained in:
@@ -74,10 +74,7 @@ impl PermVarAllocation {
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn pending(&self) -> bool {
|
||||
match self {
|
||||
&PermVarAllocation::Pending => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, &PermVarAllocation::Pending)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,9 +93,9 @@ pub enum VarAlloc {
|
||||
impl VarAlloc {
|
||||
#[inline]
|
||||
pub(crate) fn as_reg_type(&self) -> RegType {
|
||||
match self {
|
||||
&VarAlloc::Temp { temp_reg, .. } => RegType::Temp(temp_reg),
|
||||
&VarAlloc::Perm(r, _) => RegType::Perm(r),
|
||||
match *self {
|
||||
VarAlloc::Temp { temp_reg, .. } => RegType::Temp(temp_reg),
|
||||
VarAlloc::Perm(r, _) => RegType::Perm(r),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +126,7 @@ impl TempVarData {
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
false
|
||||
}
|
||||
|
||||
pub(crate) fn populate_conflict_set(&mut self) {
|
||||
@@ -201,16 +198,13 @@ impl VariableRecords {
|
||||
IndexMap::new();
|
||||
|
||||
for (var_gen_index, record) in self.0.iter_mut().enumerate() {
|
||||
match &mut record.allocation {
|
||||
VarAlloc::Temp { temp_var_data, .. } => {
|
||||
let use_set = std::mem::replace(
|
||||
&mut temp_var_data.use_set,
|
||||
IndexSet::with_hasher(FxBuildHasher::default()),
|
||||
);
|
||||
if let VarAlloc::Temp { temp_var_data, .. } = &mut record.allocation {
|
||||
let use_set = std::mem::replace(
|
||||
&mut temp_var_data.use_set,
|
||||
IndexSet::with_hasher(FxBuildHasher::default()),
|
||||
);
|
||||
|
||||
use_sets.insert(var_gen_index, use_set);
|
||||
}
|
||||
_ => {}
|
||||
use_sets.insert(var_gen_index, use_set);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,19 +213,18 @@ impl VariableRecords {
|
||||
for &(term_loc, reg) in &use_set {
|
||||
if let GenContext::Last(cn_u) = term_loc {
|
||||
for (var_gen_index, record) in self.0.iter_mut().enumerate() {
|
||||
match &mut record.allocation {
|
||||
VarAlloc::Temp {
|
||||
term_loc,
|
||||
temp_var_data,
|
||||
..
|
||||
} => {
|
||||
if cn_u == term_loc.chunk_num() && u != var_gen_index {
|
||||
if !temp_var_data.uses_reg(reg) {
|
||||
temp_var_data.no_use_set.insert(reg);
|
||||
}
|
||||
}
|
||||
if let VarAlloc::Temp {
|
||||
term_loc,
|
||||
temp_var_data,
|
||||
..
|
||||
} = &mut record.allocation
|
||||
{
|
||||
if cn_u == term_loc.chunk_num()
|
||||
&& u != var_gen_index
|
||||
&& !temp_var_data.uses_reg(reg)
|
||||
{
|
||||
temp_var_data.no_use_set.insert(reg);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user