Assert that we aren't trying to split the critical edge of a landing pad. Doing

so requires more care than this generic algorithm should handle.

llvm-svn: 137866
This commit is contained in:
Bill Wendling 2011-08-17 21:04:05 +00:00
parent 854fe433d4
commit 2dfbcc4506
1 changed files with 5 additions and 0 deletions

View File

@ -176,6 +176,11 @@ BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
BasicBlock *TIBB = TI->getParent();
BasicBlock *DestBB = TI->getSuccessor(SuccNum);
// Splitting the critical edge to a landing pad block is non-trivial. Don't do
// it in this generic function.
assert(!DestBB->isLandingPad() &&
"Cannot split critical edge to a landing pad block!");
// Create a new basic block, linking it into the CFG.
BasicBlock *NewBB = BasicBlock::Create(TI->getContext(),
TIBB->getName() + "." + DestBB->getName() + "_crit_edge");