diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2009-06-03 21:42:06 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2009-06-03 21:42:06 +0000 |
| commit | ee06b752f09611656044a7d19ad1b5a68dfc6b77 (patch) | |
| tree | e27815c529d7ee80c632616c2f74aa29bee59fcd /llvm/include | |
| parent | 6c5d61ca099dc8997a65af6c308cb98ad5e4ec0e (diff) | |
| download | bcm5719-llvm-ee06b752f09611656044a7d19ad1b5a68dfc6b77.tar.gz bcm5719-llvm-ee06b752f09611656044a7d19ad1b5a68dfc6b77.zip | |
PR4317: Handle splits where the new block is unreachable correctly in
DominatorTreeBase::Split.
llvm-svn: 72810
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/Dominators.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/include/llvm/Analysis/Dominators.h b/llvm/include/llvm/Analysis/Dominators.h index b405f5b71ed..347e239d8ea 100644 --- a/llvm/include/llvm/Analysis/Dominators.h +++ b/llvm/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); |

