[llvm-commits] [llvm] r60469 - /llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
Chris Lattner
sabre at nondot.org
Tue Dec 2 23:45:16 PST 2008
Author: lattner
Date: Wed Dec 3 01:45:15 2008
New Revision: 60469
URL: http://llvm.org/viewvc/llvm-project?rev=60469&view=rev
Log:
third time is the charm.
Modified:
llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=60469&r1=60468&r2=60469&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Wed Dec 3 01:45:15 2008
@@ -27,7 +27,9 @@
/// DeleteDeadBlock - Delete the specified block, which must have no
/// predecessors.
void llvm::DeleteDeadBlock(BasicBlock *BB) {
- assert(pred_begin(BB) == pred_end(BB) && "Block is not dead!");
+ assert((pred_begin(BB) == pred_end(BB) ||
+ // Can delete self loop.
+ BB->getSinglePredecessor() == BB) && "Block is not dead!");
TerminatorInst *BBTerm = BB->getTerminator();
// Loop through all of our successors and make sure they know that one
More information about the llvm-commits
mailing list