From c872b09676366b4c7649e7a2d06f0213e79316d6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 31 Oct 2009 22:04:43 +0000 Subject: llvm::SplitEdge should refuse to split an edge from an indirectbr. Fix CodeGenPrepare to not try to split edges from indirectbr. llvm-svn: 85690 --- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp') diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index f3c175469ac..1f9a2031f3b 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -271,6 +271,8 @@ void llvm::RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum) { /// SplitEdge - Split the edge connecting specified block. Pass P must /// not be NULL. BasicBlock *llvm::SplitEdge(BasicBlock *BB, BasicBlock *Succ, Pass *P) { + assert(!isa(BB->getTerminator()) && + "Cannot split an edge from an IndirectBrInst"); TerminatorInst *LatchTerm = BB->getTerminator(); unsigned SuccNum = 0; #ifndef NDEBUG -- cgit v1.2.3