diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-03 07:45:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-03 07:45:15 +0000 |
commit | 2973a25dbc0ee1081e34421e53b8f4308b624854 (patch) | |
tree | 7e1b30afc3ff4873062ecbbb2ea16c0fb0f1b7a6 /lib/Transforms/Utils/BasicBlockUtils.cpp | |
parent | 15efa1a1fdc612db75ba66d496c213e7cc249842 (diff) |
third time is the charm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r-- | lib/Transforms/Utils/BasicBlockUtils.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp index 1a255a4bc0..45cfe8f181 100644 --- a/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -27,7 +27,9 @@ using namespace llvm; /// 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 |