forked from OSchip/llvm-project
Use a SmallPtrSet to dedup successors in EmitSjLjDispatchBlock.
The test case ARM/2011-05-04-MultipleLandingPadSuccs.ll was creating duplicate successor list entries. llvm-svn: 162222
This commit is contained in:
parent
bda04301d4
commit
710093e360
|
@ -6151,13 +6151,12 @@ EmitSjLjDispatchBlock(MachineInstr *MI, MachineBasicBlock *MBB) const {
|
|||
}
|
||||
|
||||
// Add the jump table entries as successors to the MBB.
|
||||
MachineBasicBlock *PrevMBB = 0;
|
||||
SmallPtrSet<MachineBasicBlock*, 8> SeenMBBs;
|
||||
for (std::vector<MachineBasicBlock*>::iterator
|
||||
I = LPadList.begin(), E = LPadList.end(); I != E; ++I) {
|
||||
MachineBasicBlock *CurMBB = *I;
|
||||
if (PrevMBB != CurMBB)
|
||||
if (SeenMBBs.insert(CurMBB))
|
||||
DispContBB->addSuccessor(CurMBB);
|
||||
PrevMBB = CurMBB;
|
||||
}
|
||||
|
||||
// N.B. the order the invoke BBs are processed in doesn't matter here.
|
||||
|
|
Loading…
Reference in New Issue