summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp')
-rw-r--r--contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp b/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp
index df208a2..95a63d7 100644
--- a/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp
+++ b/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp
@@ -315,17 +315,15 @@ class FunctionDifferenceEngine {
bool Difference = false;
DenseMap<ConstantInt*,BasicBlock*> LCases;
-
- for (SwitchInst::CaseIt I = LI->case_begin(), E = LI->case_end();
- I != E; ++I)
- LCases[I.getCaseValue()] = I.getCaseSuccessor();
-
- for (SwitchInst::CaseIt I = RI->case_begin(), E = RI->case_end();
- I != E; ++I) {
- ConstantInt *CaseValue = I.getCaseValue();
+ for (auto Case : LI->cases())
+ LCases[Case.getCaseValue()] = Case.getCaseSuccessor();
+
+ for (auto Case : RI->cases()) {
+ ConstantInt *CaseValue = Case.getCaseValue();
BasicBlock *LCase = LCases[CaseValue];
if (LCase) {
- if (TryUnify) tryUnify(LCase, I.getCaseSuccessor());
+ if (TryUnify)
+ tryUnify(LCase, Case.getCaseSuccessor());
LCases.erase(CaseValue);
} else if (Complain || !Difference) {
if (Complain)
OpenPOWER on IntegriCloud