llvm.org GIT mirror llvm / f4c261b
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 Stepan Dyatkovskiy 8 years ago
2 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
11041104 nl(Out);
11051105 for (SwitchInst::ConstCaseIt i = SI->case_begin(), e = SI->case_end();
11061106 i != e; ++i) {
1107 const ConstantInt* CaseVal = i.getCaseValue();
1107 const ConstantRangesSet CaseVal = i.getCaseValueEx();
11081108 const BasicBlock *BB = i.getCaseSuccessor();
11091109 Out << iName << "->addCase("
11101110 << getOpName(CaseVal) << ", "
317317
318318 bool Difference = false;
319319
320 DenseMapInt*,BasicBlock*> LCases;
320 DenseMap*, BasicBlock*> LCases;
321321
322322 for (SwitchInst::CaseIt I = LI->case_begin(), E = LI->case_end();
323323 I != E; ++I)
324 LCases[I.getCaseValue()] = I.getCaseSuccessor();
324 LCases[I.getCaseValueEx()] = I.getCaseSuccessor();
325325
326326 for (SwitchInst::CaseIt I = RI->case_begin(), E = RI->case_end();
327327 I != E; ++I) {
328 ConstantInt *CaseValue = I.getCaseValue();
328 ConstantRangesSet CaseValue = I.getCaseValueEx();
329329 BasicBlock *LCase = LCases[CaseValue];
330330 if (LCase) {
331331 if (TryUnify) tryUnify(LCase, I.getCaseSuccessor());
337337 }
338338 }
339339 if (!Difference)
340 for (DenseMapInt*,BasicBlock*>::iterator
340 for (DenseMap*, BasicBlock*>::iterator
341341 I = LCases.begin(), E = LCases.end(); I != E; ++I) {
342342 if (Complain)
343343 Engine.logf("left switch has extra case %l") << I->first;