Skip to content

Commit 40fb4ee

Browse files
committed
[NFCI][Local] TryToSimplifyUncondBranchFromEmptyBlock(): use DeleteDeadBlocks()
1 parent c60ca98 commit 40fb4ee

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Transforms/Utils/Local.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,12 +1150,11 @@ bool llvm::TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB,
11501150
assert(succ_empty(BB) && "The successor list of BB isn't empty before "
11511151
"applying corresponding DTU updates.");
11521152

1153-
if (DTU) {
1153+
if (DTU)
11541154
DTU->applyUpdates(Updates);
1155-
DTU->deleteBB(BB);
1156-
} else {
1157-
BB->eraseFromParent(); // Delete the old basic block.
1158-
}
1155+
1156+
DeleteDeadBlock(BB, DTU);
1157+
11591158
return true;
11601159
}
11611160

0 commit comments

Comments
 (0)