diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-03 06:40:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-03 06:40:52 +0000 |
commit | c1afa2d327f19062ae9e80735da0b48b3e671753 (patch) | |
tree | bc2e880e4b5bdd53cfb349bd09848eb5b745c75e /lib/Transforms/Utils/BasicBlockUtils.cpp | |
parent | 1c3bb5a1412639ddcf56550593f96f106fbfd9b4 (diff) | |
download | external_llvm-c1afa2d327f19062ae9e80735da0b48b3e671753.zip external_llvm-c1afa2d327f19062ae9e80735da0b48b3e671753.tar.gz external_llvm-c1afa2d327f19062ae9e80735da0b48b3e671753.tar.bz2 |
Rename DeleteBlockIfDead to DeleteDeadBlock and make it
unconditionally delete the block. All likely clients will
do the checking anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r-- | lib/Transforms/Utils/BasicBlockUtils.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp index bfcf375..9452e6e 100644 --- a/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -24,14 +24,10 @@ #include <algorithm> using namespace llvm; -/// DeleteBlockIfDead - If the specified basic block is trivially dead (has no -/// predecessors and not the entry block), delete it and return true. Otherwise -/// return false. -bool llvm::DeleteBlockIfDead(BasicBlock *BB) { - if (pred_begin(BB) != pred_end(BB) || - BB == &BB->getParent()->getEntryBlock()) - return false; - +/// 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!"); TerminatorInst *BBTerm = BB->getTerminator(); // Loop through all of our successors and make sure they know that one @@ -54,7 +50,6 @@ bool llvm::DeleteBlockIfDead(BasicBlock *BB) { // Zap the block! BB->eraseFromParent(); - return true; } /// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor, |