diff options
Diffstat (limited to 'contrib/llvm/tools/llvm-diff')
-rw-r--r-- | contrib/llvm/tools/llvm-diff/DiffConsumer.cpp | 7 | ||||
-rw-r--r-- | contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp | 16 |
2 files changed, 11 insertions, 12 deletions
diff --git a/contrib/llvm/tools/llvm-diff/DiffConsumer.cpp b/contrib/llvm/tools/llvm-diff/DiffConsumer.cpp index 9078013..e167750 100644 --- a/contrib/llvm/tools/llvm-diff/DiffConsumer.cpp +++ b/contrib/llvm/tools/llvm-diff/DiffConsumer.cpp @@ -15,6 +15,7 @@ #include "llvm/IR/Instructions.h" #include "llvm/IR/Module.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/Debug.h" using namespace llvm; @@ -195,17 +196,17 @@ void DiffConsumer::logd(const DiffLogBuilder &Log) { switch (Log.getLineKind(I)) { case DC_match: out << " "; - Log.getLeft(I)->dump(); + Log.getLeft(I)->print(dbgs()); dbgs() << '\n'; //printValue(Log.getLeft(I), true); break; case DC_left: out << "< "; - Log.getLeft(I)->dump(); + Log.getLeft(I)->print(dbgs()); dbgs() << '\n'; //printValue(Log.getLeft(I), true); break; case DC_right: out << "> "; - Log.getRight(I)->dump(); + Log.getRight(I)->print(dbgs()); dbgs() << '\n'; //printValue(Log.getRight(I), false); break; } 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) |