diff options
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Instructions.cpp | 10 | ||||
-rw-r--r-- | lib/VMCore/Verifier.cpp | 16 |
2 files changed, 13 insertions, 13 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 42a92d9..26cc632 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -3169,16 +3169,16 @@ SwitchInst::~SwitchInst() { /// addCase - Add an entry to the switch instruction... /// void SwitchInst::addCase(ConstantInt *OnVal, BasicBlock *Dest) { - CRSBuilder CB; + IntegersSubsetToBB Mapping; // FIXME: Currently we work with ConstantInt based cases. // So inititalize IntItem container directly from ConstantInt. - CB.add(IntItem::fromConstantInt(OnVal)); - ConstantRangesSet CRS = CB.getCase(); - addCase(CRS, Dest); + Mapping.add(IntItem::fromConstantInt(OnVal)); + IntegersSubset CaseRanges = Mapping.getCase(); + addCase(CaseRanges, Dest); } -void SwitchInst::addCase(ConstantRangesSet& OnVal, BasicBlock *Dest) { +void SwitchInst::addCase(IntegersSubset& OnVal, BasicBlock *Dest) { unsigned NewCaseIdx = getNumCases(); unsigned OpNo = NumOperands; if (OpNo+2 > ReservedSpace) diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index c546e41..cae3bc8 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -806,23 +806,23 @@ void Verifier::visitSwitchInst(SwitchInst &SI) { // have the same type as the switched-on value. Type *SwitchTy = SI.getCondition()->getType(); IntegerType *IntTy = cast<IntegerType>(SwitchTy); - CRSBuilder Builder; - std::map<ConstantRangesSet::Range, unsigned> RangeSetMap; + IntegersSubsetToBB Mapping; + std::map<IntegersSubset::Range, unsigned> RangeSetMap; for (SwitchInst::CaseIt i = SI.case_begin(), e = SI.case_end(); i != e; ++i) { - ConstantRangesSet RS = i.getCaseValueEx(); - for (unsigned ri = 0, rie = RS.getNumItems(); ri < rie; ++ri) { - ConstantRangesSet::Range r = RS.getItem(ri); + IntegersSubset CaseRanges = i.getCaseValueEx(); + for (unsigned ri = 0, rie = CaseRanges.getNumItems(); ri < rie; ++ri) { + IntegersSubset::Range r = CaseRanges.getItem(ri); Assert1(r.Low->getBitWidth() == IntTy->getBitWidth(), "Switch constants must all be same type as switch value!", &SI); Assert1(r.High->getBitWidth() == IntTy->getBitWidth(), "Switch constants must all be same type as switch value!", &SI); - Builder.add(r); + Mapping.add(r); RangeSetMap[r] = i.getCaseIndex(); } } - CRSBuilder::RangeIterator errItem; - if (!Builder.verify(errItem)) { + IntegersSubsetToBB::RangeIterator errItem; + if (!Mapping.verify(errItem)) { unsigned CaseIndex = RangeSetMap[errItem->first]; SwitchInst::CaseIt i(&SI, CaseIndex); Assert2(false, "Duplicate integer as switch case", &SI, i.getCaseValueEx()); |