1
Fork 0

MatchBranchSimplification: Consider empty-unreachable otherwise branch

This commit is contained in:
clubby789 2024-10-04 20:26:41 +00:00
parent 11f7e302e1
commit e32ec45c02
7 changed files with 81 additions and 48 deletions

View file

@ -67,6 +67,17 @@ impl SwitchTargets {
&mut self.targets
}
/// Returns a slice with all considered values (not including the fallback).
#[inline]
pub fn all_values(&self) -> &[Pu128] {
&self.values
}
#[inline]
pub fn all_values_mut(&mut self) -> &mut [Pu128] {
&mut self.values
}
/// Finds the `BasicBlock` to which this `SwitchInt` will branch given the
/// specific value. This cannot fail, as it'll return the `otherwise`
/// branch if there's not a specific match for the value.