From: Bill Wendling Date: Fri, 11 Dec 2009 10:43:41 +0000 (+0000) Subject: Revert part of r91101 which was causing an infinite loop in the self-hosting X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a288b2f43a6b1a87fcd9b10c5fd46f3c65c478a0;p=oota-llvm.git Revert part of r91101 which was causing an infinite loop in the self-hosting build bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91113 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 7ce723e019a..0097dd16105 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -457,11 +457,16 @@ MachineBasicBlock::BranchesToLandingPad(const MachineBasicBlock *MBB) const { SmallSet Visited; const MachineBasicBlock *CurMBB = MBB; - while (!CurMBB->isLandingPad()) { - if (CurMBB->succ_size() != 1) + while (!Visited.count(CurMBB) && !CurMBB->isLandingPad()) { + if (CurMBB->size() != 1 || CurMBB->succ_empty() || CurMBB->succ_size() != 1) break; - if (!Visited.insert(CurMBB)) break; + const TargetInstrInfo *TII = + CurMBB->getParent()->getTarget().getInstrInfo(); + if (!TII->isUnpredicatedTerminator(CurMBB->begin())) + break; + + Visited.insert(CurMBB); CurMBB = *CurMBB->succ_begin(); }