Auto merge of #131244 - clubby789:match-branches-unreachable, r=DianQK
Consider empty-unreachable otherwise branches in MatchBranchSimplification Fixes #131219
This commit is contained in:
commit
4e0bc490c6
7 changed files with 108 additions and 29 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