summaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/Dominators.h
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-06 08:20:29 +0000
committered <ed@FreeBSD.org>2009-06-06 08:20:29 +0000
commit2361a5c2bfbaef476824e51fa72712e334219c7b (patch)
tree8a1bbd1a5b838080d31e5c93a1817006b8c62318 /include/llvm/Analysis/Dominators.h
parent1941b8772a36a33c7b86cb67163cd735b3d57221 (diff)
downloadFreeBSD-src-2361a5c2bfbaef476824e51fa72712e334219c7b.zip
FreeBSD-src-2361a5c2bfbaef476824e51fa72712e334219c7b.tar.gz
Import LLVM, at r72995.
We should now have support for #pragma weak.
Diffstat (limited to 'include/llvm/Analysis/Dominators.h')
-rw-r--r--include/llvm/Analysis/Dominators.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index b405f5b..347e239 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -270,12 +270,17 @@ protected:
NewBBIDom = PredBlocks[i];
break;
}
- assert(i != PredBlocks.size() && "No reachable preds?");
+
+ // It's possible that none of the predecessors of NewBB are reachable;
+ // in that case, NewBB itself is unreachable, so nothing needs to be
+ // changed.
+ if (!NewBBIDom)
+ return;
+
for (i = i + 1; i < PredBlocks.size(); ++i) {
if (DT.isReachableFromEntry(PredBlocks[i]))
NewBBIDom = DT.findNearestCommonDominator(NewBBIDom, PredBlocks[i]);
}
- assert(NewBBIDom && "No immediate dominator found??");
// Create the new dominator tree node... and set the idom of NewBB.
DomTreeNodeBase<NodeT> *NewBBNode = DT.addNewBlock(NewBB, NewBBIDom);
OpenPOWER on IntegriCloud