summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils
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
commit490606e613566d1c7d49d2544c76c207a2555915 (patch)
treeb0c22058d70f85ebcea129057c50c54d8dc1e82b /lib/Transforms/Utils
parentef3bf64bf8f1e3147c78b772c6c57139403e4022 (diff)
downloadllvm-490606e613566d1c7d49d2544c76c207a2555915.tar.gz
llvm-490606e613566d1c7d49d2544c76c207a2555915.tar.bz2
llvm-490606e613566d1c7d49d2544c76c207a2555915.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r--lib/Transforms/Utils/BreakCriticalEdges.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp
index 803e431f76..03770cc1da 100644
--- a/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/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");