From f4c261b1378b0f7aaede3a791f0e05c9ab94ea34 Mon Sep 17 00:00:00 2001 From: Stepan Dyatkovskiy Date: Sat, 19 May 2012 13:14:30 +0000 Subject: [PATCH] Ordinary PR1255 patch: DifferenceEngine and CPPBackend adopted to the new SwitchInst methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157112 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/CppBackend/CPPBackend.cpp | 2 +- tools/llvm-diff/DifferenceEngine.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 69f0ff87eda..9f9545559c9 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -1105,7 +1105,7 @@ void CppWriter::printInstruction(const Instruction *I, nl(Out); for (SwitchInst::ConstCaseIt i = SI->case_begin(), e = SI->case_end(); i != e; ++i) { - const ConstantInt* CaseVal = i.getCaseValue(); + const ConstantRangesSet CaseVal = i.getCaseValueEx(); const BasicBlock *BB = i.getCaseSuccessor(); Out << iName << "->addCase(" << getOpName(CaseVal) << ", " diff --git a/tools/llvm-diff/DifferenceEngine.cpp b/tools/llvm-diff/DifferenceEngine.cpp index a5a99f5b9c4..0e7815b26ba 100644 --- a/tools/llvm-diff/DifferenceEngine.cpp +++ b/tools/llvm-diff/DifferenceEngine.cpp @@ -318,15 +318,15 @@ class FunctionDifferenceEngine { bool Difference = false; - DenseMap LCases; + DenseMap LCases; for (SwitchInst::CaseIt I = LI->case_begin(), E = LI->case_end(); I != E; ++I) - LCases[I.getCaseValue()] = I.getCaseSuccessor(); + LCases[I.getCaseValueEx()] = I.getCaseSuccessor(); for (SwitchInst::CaseIt I = RI->case_begin(), E = RI->case_end(); I != E; ++I) { - ConstantInt *CaseValue = I.getCaseValue(); + ConstantRangesSet CaseValue = I.getCaseValueEx(); BasicBlock *LCase = LCases[CaseValue]; if (LCase) { if (TryUnify) tryUnify(LCase, I.getCaseSuccessor()); @@ -338,7 +338,7 @@ class FunctionDifferenceEngine { } } if (!Difference) - for (DenseMap::iterator + for (DenseMap::iterator I = LCases.begin(), E = LCases.end(); I != E; ++I) { if (Complain) Engine.logf("left switch has extra case %l") << I->first;