Skip to content

Commit 69a43e5

Browse files
committed
[NFCI][SimplifyCFG] simplifyReturn(): use DeleteDeadBlock()
1 parent 00f90e3 commit 69a43e5

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4645,13 +4645,8 @@ bool SimplifyCFGOpt::simplifyReturn(ReturnInst *RI, IRBuilder<> &Builder) {
46454645
}
46464646

46474647
// If we eliminated all predecessors of the block, delete the block now.
4648-
if (pred_empty(BB)) {
4649-
// We know there are no successors, so just nuke the block.
4650-
if (DTU)
4651-
DTU->deleteBB(BB);
4652-
else
4653-
BB->eraseFromParent();
4654-
}
4648+
if (pred_empty(BB))
4649+
DeleteDeadBlock(BB, DTU);
46554650

46564651
return true;
46574652
}

0 commit comments

Comments
 (0)