Skip to content
Snippets Groups Projects
Unverified Commit c60ca985 authored by Roman Lebedev's avatar Roman Lebedev
Browse files

[NFCI][Local] MergeBlockIntoPredecessor(): use DeleteDeadBlocks()

parent b0bb2149
No related branches found
No related tags found
No related merge requests found
......@@ -298,17 +298,11 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, DomTreeUpdater *DTU,
if (MemDep)
MemDep->invalidateCachedPredecessors();
// Finally, erase the old block and update dominator info.
if (DTU) {
assert(BB->getInstList().size() == 1 &&
isa<UnreachableInst>(BB->getTerminator()) &&
"The successor list of BB isn't empty before "
"applying corresponding DTU updates.");
if (DTU)
DTU->applyUpdates(Updates);
DTU->deleteBB(BB);
} else {
BB->eraseFromParent(); // Nuke BB if DTU is nullptr.
}
// Finally, erase the old block and update dominator info.
DeleteDeadBlock(BB, DTU);
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment