aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-08-17 21:04:05 +0000
committerBill Wendling <isanbard@gmail.com>2011-08-17 21:04:05 +0000
commit2dfbcc45064b8e5d0a6fe8ea792cd7e092839156 (patch)
treeec04bb592ffd03bc83a4e8564b712bcbd012827c /llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
parent854fe433d46081a4dded8d2cc7b0d867c1730598 (diff)
downloadllvm-2dfbcc45064b8e5d0a6fe8ea792cd7e092839156.zip
llvm-2dfbcc45064b8e5d0a6fe8ea792cd7e092839156.tar.gz
llvm-2dfbcc45064b8e5d0a6fe8ea792cd7e092839156.tar.bz2
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
Diffstat (limited to 'llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
index 803e431..03770cc 100644
--- a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
@@ -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");