diff options
author | Vasileios Porpodas <vporpodas@google.com> | 2022-11-28 14:45:59 -0800 |
---|---|---|
committer | Vasileios Porpodas <vporpodas@google.com> | 2022-12-01 15:37:51 -0800 |
commit | bebca2b6d559f545c82047b2071273b4c243d13b (patch) | |
tree | 3b9094a4323f7c58aeb49dd9553013c253a62511 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 467432899bc2f71842ed1b24d24c094da02af7d4 (diff) | |
download | llvm-bebca2b6d559f545c82047b2071273b4c243d13b.zip llvm-bebca2b6d559f545c82047b2071273b4c243d13b.tar.gz llvm-bebca2b6d559f545c82047b2071273b4c243d13b.tar.bz2 |
[NFC] Cleanup: Replaces BB->getInstList().splice() with BB->splice().
This is part of a series of cleanup patches towards making BasicBlock::getInstList() private.
Differential Revision: https://reviews.llvm.org/D138979
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 82501cd..c9fe093 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -799,7 +799,7 @@ void llvm::MergeBasicBlockIntoOnlyPred(BasicBlock *DestBB, // Splice all the instructions from PredBB to DestBB. PredBB->getTerminator()->eraseFromParent(); - DestBB->getInstList().splice(DestBB->begin(), PredBB->getInstList()); + DestBB->splice(DestBB->begin(), PredBB); new UnreachableInst(PredBB->getContext(), PredBB); // If the PredBB is the entry block of the function, move DestBB up to @@ -1204,8 +1204,7 @@ bool llvm::TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB, // Copy over any phi, debug or lifetime instruction. BB->getTerminator()->eraseFromParent(); - Succ->getInstList().splice(Succ->getFirstNonPHI()->getIterator(), - BB->getInstList()); + Succ->splice(Succ->getFirstNonPHI()->getIterator(), BB); } else { while (PHINode *PN = dyn_cast<PHINode>(&BB->front())) { // We explicitly check for such uses in CanPropagatePredecessorsForPHIs. @@ -2962,9 +2961,8 @@ void llvm::hoistAllInstructionsInto(BasicBlock *DomBlock, Instruction *InsertPt, I->setDebugLoc(InsertPt->getDebugLoc()); ++II; } - DomBlock->getInstList().splice(InsertPt->getIterator(), BB->getInstList(), - BB->begin(), - BB->getTerminator()->getIterator()); + DomBlock->splice(InsertPt->getIterator(), BB, BB->begin(), + BB->getTerminator()->getIterator()); } namespace { |