mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Standardize {pred,succ,use,user}_empty()
The functions {pred,succ,use,user}_{begin,end} exist, but many users have to check *_begin() with *_end() by hand to determine if the BasicBlock or User is empty. Fix this with a standard *_empty(), demonstrating a few usecases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225760 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -188,7 +188,7 @@ bool JumpThreading::runOnFunction(Function &F) {
|
||||
|
||||
// If the block is trivially dead, zap it. This eliminates the successor
|
||||
// edges which simplifies the CFG.
|
||||
if (pred_begin(BB) == pred_end(BB) &&
|
||||
if (pred_empty(BB) &&
|
||||
BB != &BB->getParent()->getEntryBlock()) {
|
||||
DEBUG(dbgs() << " JT: Deleting dead block '" << BB->getName()
|
||||
<< "' with terminator: " << *BB->getTerminator() << '\n');
|
||||
@ -662,7 +662,7 @@ static bool hasAddressTakenAndUsed(BasicBlock *BB) {
|
||||
bool JumpThreading::ProcessBlock(BasicBlock *BB) {
|
||||
// If the block is trivially dead, just return and let the caller nuke it.
|
||||
// This simplifies other transformations.
|
||||
if (pred_begin(BB) == pred_end(BB) &&
|
||||
if (pred_empty(BB) &&
|
||||
BB != &BB->getParent()->getEntryBlock())
|
||||
return false;
|
||||
|
||||
|
Reference in New Issue
Block a user