summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-12-11 10:43:41 +0000
committerBill Wendling <isanbard@gmail.com>2009-12-11 10:43:41 +0000
commit9f13fc7d63a93bc2e4ae9efcc685a49242d57dbb (patch)
tree54306925264bb6a5bfea8f7a43c5204b367a7919 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent68396b16f64f32c75a5e6c0d8c81e06ad0a519a2 (diff)
downloadbcm5719-llvm-9f13fc7d63a93bc2e4ae9efcc685a49242d57dbb.tar.gz
bcm5719-llvm-9f13fc7d63a93bc2e4ae9efcc685a49242d57dbb.zip
Revert part of r91101 which was causing an infinite loop in the self-hosting
build bots. llvm-svn: 91113
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 7ce723e019a..0097dd16105 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -457,11 +457,16 @@ MachineBasicBlock::BranchesToLandingPad(const MachineBasicBlock *MBB) const {
SmallSet<const MachineBasicBlock*, 32> 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();
}
OpenPOWER on IntegriCloud