MatchBranchSimplification: Consider empty-unreachable otherwise branch
This commit is contained in:
parent
11f7e302e1
commit
e32ec45c02
7 changed files with 81 additions and 48 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue