From: Jakob Stoklund Olesen Date: Mon, 20 Aug 2012 20:52:03 +0000 (+0000) Subject: Use a SmallPtrSet to dedup successors in EmitSjLjDispatchBlock. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=a0708d1109c2c1a3cf911a4761a10ad69a28455e;p=oota-llvm.git Use a SmallPtrSet to dedup successors in EmitSjLjDispatchBlock. The test case ARM/2011-05-04-MultipleLandingPadSuccs.ll was creating duplicate successor list entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162222 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 3974d057a8d..df4039b8413 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -6151,13 +6151,12 @@ EmitSjLjDispatchBlock(MachineInstr *MI, MachineBasicBlock *MBB) const { } // Add the jump table entries as successors to the MBB. - MachineBasicBlock *PrevMBB = 0; + SmallPtrSet SeenMBBs; for (std::vector::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.