mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
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
This commit is contained in:
@@ -26,10 +26,9 @@ class Instruction;
|
|||||||
class Pass;
|
class Pass;
|
||||||
class AliasAnalysis;
|
class AliasAnalysis;
|
||||||
|
|
||||||
/// DeleteBlockIfDead - If the specified basic block is trivially dead (has no
|
/// DeleteDeadBlock - Delete the specified block, which must have no
|
||||||
/// predecessors and not the entry block), delete it and return true. Otherwise
|
/// predecessors.
|
||||||
/// return false.
|
void DeleteDeadBlock(BasicBlock *BB);
|
||||||
bool DeleteBlockIfDead(BasicBlock *BB);
|
|
||||||
|
|
||||||
/// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor,
|
/// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor,
|
||||||
/// if possible. The return value indicates success or failure.
|
/// if possible. The return value indicates success or failure.
|
||||||
|
@@ -24,14 +24,10 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
/// DeleteBlockIfDead - If the specified basic block is trivially dead (has no
|
/// DeleteDeadBlock - Delete the specified block, which must have no
|
||||||
/// predecessors and not the entry block), delete it and return true. Otherwise
|
/// predecessors.
|
||||||
/// return false.
|
void llvm::DeleteDeadBlock(BasicBlock *BB) {
|
||||||
bool llvm::DeleteBlockIfDead(BasicBlock *BB) {
|
assert(pred_begin(BB) != pred_end(BB) && "Block is not dead!");
|
||||||
if (pred_begin(BB) != pred_end(BB) ||
|
|
||||||
BB == &BB->getParent()->getEntryBlock())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
TerminatorInst *BBTerm = BB->getTerminator();
|
TerminatorInst *BBTerm = BB->getTerminator();
|
||||||
|
|
||||||
// Loop through all of our successors and make sure they know that one
|
// 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!
|
// Zap the block!
|
||||||
BB->eraseFromParent();
|
BB->eraseFromParent();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor,
|
/// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor,
|
||||||
|
@@ -1681,7 +1681,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||||||
// as a predecessor. These are unreachable.
|
// as a predecessor. These are unreachable.
|
||||||
if (pred_begin(BB) == pred_end(BB) || BB->getSinglePredecessor() == BB) {
|
if (pred_begin(BB) == pred_end(BB) || BB->getSinglePredecessor() == BB) {
|
||||||
DOUT << "Removing BB: \n" << *BB;
|
DOUT << "Removing BB: \n" << *BB;
|
||||||
DeleteBlockIfDead(BB);
|
DeleteDeadBlock(BB);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user