[llvm-branch-commits] [llvm-branch] r136122 - /llvm/branches/exception-handling-rewrite/lib/Transforms/Utils/BreakCriticalEdges.cpp
Bill Wendling
isanbard at gmail.com
Tue Jul 26 12:55:19 PDT 2011
Author: void
Date: Tue Jul 26 14:55:19 2011
New Revision: 136122
URL: http://llvm.org/viewvc/llvm-project?rev=136122&view=rev
Log:
Forbid the critical edge splitter from splitting an invoke's unwind edge.
Modified:
llvm/branches/exception-handling-rewrite/lib/Transforms/Utils/BreakCriticalEdges.cpp
Modified: llvm/branches/exception-handling-rewrite/lib/Transforms/Utils/BreakCriticalEdges.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/exception-handling-rewrite/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=136122&r1=136121&r2=136122&view=diff
==============================================================================
--- llvm/branches/exception-handling-rewrite/lib/Transforms/Utils/BreakCriticalEdges.cpp (original)
+++ llvm/branches/exception-handling-rewrite/lib/Transforms/Utils/BreakCriticalEdges.cpp Tue Jul 26 14:55:19 2011
@@ -172,13 +172,17 @@
assert(!isa<IndirectBrInst>(TI) &&
"Cannot split critical edge from IndirectBrInst");
-
+ assert((!isa<InvokeInst>(TI) ||
+ cast<InvokeInst>(TI)->getUnwindDest() != TI->getSuccessor(SuccNum)) &&
+ "Cannot split critical edge from InvokeInst's unwind edge!");
+
BasicBlock *TIBB = TI->getParent();
BasicBlock *DestBB = TI->getSuccessor(SuccNum);
// Create a new basic block, linking it into the CFG.
BasicBlock *NewBB = BasicBlock::Create(TI->getContext(),
TIBB->getName() + "." + DestBB->getName() + "_crit_edge");
+
// Create our unconditional branch.
BranchInst *NewBI = BranchInst::Create(DestBB, NewBB);
NewBI->setDebugLoc(TI->getDebugLoc());
More information about the llvm-branch-commits
mailing list