File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1000,20 +1000,20 @@ bool SimplifyCFGOpt::simplifyEqualityComparisonWithOnlyPredecessor(
1000
1000
// which value (or set of values) this is.
1001
1001
ConstantInt *TIV = nullptr ;
1002
1002
BasicBlock *TIBB = TI->getParent ();
1003
- for (unsigned i = 0 , e = PredCases. size (); i != e; ++i )
1004
- if (PredCases[i]. Dest == TIBB) {
1003
+ for (const auto &[Value, Dest] : PredCases)
1004
+ if (Dest == TIBB) {
1005
1005
if (TIV)
1006
1006
return false ; // Cannot handle multiple values coming to this block.
1007
- TIV = PredCases[i]. Value ;
1007
+ TIV = Value;
1008
1008
}
1009
1009
assert (TIV && " No edge from pred to succ?" );
1010
1010
1011
1011
// Okay, we found the one constant that our value can be if we get into TI's
1012
1012
// BB. Find out which successor will unconditionally be branched to.
1013
1013
BasicBlock *TheRealDest = nullptr ;
1014
- for (unsigned i = 0 , e = ThisCases. size (); i != e; ++i )
1015
- if (ThisCases[i]. Value == TIV) {
1016
- TheRealDest = ThisCases[i]. Dest ;
1014
+ for (const auto &[Value, Dest] : ThisCases)
1015
+ if (Value == TIV) {
1016
+ TheRealDest = Dest;
1017
1017
break ;
1018
1018
}
1019
1019
You can’t perform that action at this time.
0 commit comments