mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +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:
@ -200,7 +200,7 @@ bool PruneEH::SimplifyFunction(Function *F) {
|
||||
BB->getInstList().pop_back();
|
||||
|
||||
// If the unwind block is now dead, nuke it.
|
||||
if (pred_begin(UnwindBlock) == pred_end(UnwindBlock))
|
||||
if (pred_empty(UnwindBlock))
|
||||
DeleteBasicBlock(UnwindBlock); // Delete the new BB.
|
||||
|
||||
++NumRemoved;
|
||||
@ -234,7 +234,7 @@ bool PruneEH::SimplifyFunction(Function *F) {
|
||||
/// updating the callgraph to reflect any now-obsolete edges due to calls that
|
||||
/// exist in the BB.
|
||||
void PruneEH::DeleteBasicBlock(BasicBlock *BB) {
|
||||
assert(pred_begin(BB) == pred_end(BB) && "BB is not dead!");
|
||||
assert(pred_empty(BB) && "BB is not dead!");
|
||||
CallGraph &CG = getAnalysis<CallGraphWrapperPass>().getCallGraph();
|
||||
|
||||
CallGraphNode *CGN = CG[BB->getParent()];
|
||||
|
Reference in New Issue
Block a user