diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 578f8d2f3da8..4c4b0f951d5e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -970,24 +970,21 @@ void SelectionDAGLowering::visitSwitch(SwitchInst &I) { // of the jump table. If the value of the jump table slot corresponds to // a case statement, push the case's BB onto the vector, otherwise, push // the default BB. - std::set UniqueBBs; std::vector DestBBs; uint64_t TEI = First; for (CaseItr ii = Cases.begin(), ee = Cases.end(); ii != ee; ++TEI) { if (cast(ii->first)->getRawValue() == TEI) { DestBBs.push_back(ii->second); - UniqueBBs.insert(ii->second); ++ii; } else { DestBBs.push_back(Default); - UniqueBBs.insert(Default); } } // Update successor info - for (std::set::iterator ii = UniqueBBs.begin(), - ee = UniqueBBs.end(); ii != ee; ++ii) - JumpTableBB->addSuccessor(*ii); + for (std::vector::iterator I = DestBBs.begin(), + E = DestBBs.end(); I != E; ++I) + JumpTableBB->addSuccessor(*I); // Create a jump table index for this jump table, or return an existing // one.