summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-05-13 20:24:53 +0000
committerSanjay Patel <spatel@rotateright.com>2016-05-13 20:24:53 +0000
commit5d5134f676a178d37bcccc721cbf0c9c1c97a61c (patch)
tree3bc1172fe722a564bd26e7bb3b2d901e11c42459 /llvm/lib/Transforms/Utils
parent25a7330cc8fad30267a1a17b5aa4846a6d71f6ca (diff)
downloadbcm5719-llvm-5d5134f676a178d37bcccc721cbf0c9c1c97a61c.tar.gz
bcm5719-llvm-5d5134f676a178d37bcccc721cbf0c9c1c97a61c.zip
use range-loops; NFCI
llvm-svn: 269471
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 7f5e7eb193c..0eebd8f3327 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -3865,12 +3865,12 @@ static bool EliminateDeadSwitchCases(SwitchInst *SI, AssumptionCache *AC,
// Gather dead cases.
SmallVector<ConstantInt*, 8> DeadCases;
- for (SwitchInst::CaseIt I = SI->case_begin(), E = SI->case_end(); I != E; ++I) {
- if ((I.getCaseValue()->getValue() & KnownZero) != 0 ||
- (I.getCaseValue()->getValue() & KnownOne) != KnownOne) {
- DeadCases.push_back(I.getCaseValue());
+ for (auto &Case : SI->cases()) {
+ if ((Case.getCaseValue()->getValue() & KnownZero) != 0 ||
+ (Case.getCaseValue()->getValue() & KnownOne) != KnownOne) {
+ DeadCases.push_back(Case.getCaseValue());
DEBUG(dbgs() << "SimplifyCFG: switch case '"
- << I.getCaseValue() << "' is dead.\n");
+ << Case.getCaseValue() << "' is dead.\n");
}
}
@@ -3905,8 +3905,8 @@ static bool EliminateDeadSwitchCases(SwitchInst *SI, AssumptionCache *AC,
}
// Remove dead cases from the switch.
- for (unsigned I = 0, E = DeadCases.size(); I != E; ++I) {
- SwitchInst::CaseIt Case = SI->findCaseValue(DeadCases[I]);
+ for (ConstantInt *DeadCase : DeadCases) {
+ SwitchInst::CaseIt Case = SI->findCaseValue(DeadCase);
assert(Case != SI->case_default() &&
"Case was not found. Probably mistake in DeadCases forming.");
if (HasWeight) {
OpenPOWER on IntegriCloud