diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-05-15 12:38:27 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-05-15 12:41:58 +0200 |
commit | fb9ed1979a712a86c246dc136f8134e8e97a883c (patch) | |
tree | 226f12f0ab580b394f6979b03bafc5c85c31f59f /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | |
parent | eae445f65d077304703e3290ddb4ff28f6d65ff4 (diff) | |
download | llvm-fb9ed1979a712a86c246dc136f8134e8e97a883c.zip llvm-fb9ed1979a712a86c246dc136f8134e8e97a883c.tar.gz llvm-fb9ed1979a712a86c246dc136f8134e8e97a883c.tar.bz2 |
[IR] Add BasicBlock::isEntryBlock() (NFC)
This is a recurring and somewhat awkward pattern. Add a helper
method for it.
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index 5690200..e3cf643 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -887,7 +887,7 @@ static void UpdateAnalysisInformation(BasicBlock *OldBB, BasicBlock *NewBB, if (DTU) { // Recalculation of DomTree is needed when updating a forward DomTree and // the Entry BB is replaced. - if (NewBB == &NewBB->getParent()->getEntryBlock() && DTU->hasDomTree()) { + if (NewBB->isEntryBlock() && DTU->hasDomTree()) { // The entry block was removed and there is no external interface for // the dominator tree to be notified of this change. In this corner-case // we recalculate the entire tree. @@ -906,7 +906,7 @@ static void UpdateAnalysisInformation(BasicBlock *OldBB, BasicBlock *NewBB, } } else if (DT) { if (OldBB == DT->getRootNode()->getBlock()) { - assert(NewBB == &NewBB->getParent()->getEntryBlock()); + assert(NewBB->isEntryBlock()); DT->setNewRoot(NewBB); } else { // Split block expects NewBB to have a non-empty set of predecessors. |