aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorVasileios Porpodas <vporpodas@google.com>2022-11-23 14:53:00 -0800
committerVasileios Porpodas <vporpodas@google.com>2022-11-23 22:47:46 -0800
commitaf4e856fa71c6b5086aeda79bfcd954e98cef591 (patch)
treea22619357ddbe79735f53b3c8fff7a5e61ba2084 /llvm/lib/Transforms/Utils/Local.cpp
parentfbcdf4a4fb9e51039877cc92bb18407416a158d7 (diff)
downloadllvm-af4e856fa71c6b5086aeda79bfcd954e98cef591.zip
llvm-af4e856fa71c6b5086aeda79bfcd954e98cef591.tar.gz
llvm-af4e856fa71c6b5086aeda79bfcd954e98cef591.tar.bz2
[NFC] Replaced BB->getInstList().{erase(),pop_front(),pop_back()} with eraseFromParent().
Differential Revision: https://reviews.llvm.org/D138617
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 8f996e9..2e0b4b0 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -807,7 +807,7 @@ void llvm::MergeBasicBlockIntoOnlyPred(BasicBlock *DestBB,
DestBB->moveAfter(PredBB);
if (DTU) {
- assert(PredBB->getInstList().size() == 1 &&
+ assert(PredBB->size() == 1 &&
isa<UnreachableInst>(PredBB->getTerminator()) &&
"The successor list of PredBB isn't empty before "
"applying corresponding DTU updates.");
@@ -1228,7 +1228,7 @@ bool llvm::TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB,
// Clear the successor list of BB to match updates applying to DTU later.
if (BB->getTerminator())
- BB->getInstList().pop_back();
+ BB->back().eraseFromParent();
new UnreachableInst(BB->getContext(), BB);
assert(succ_empty(BB) && "The successor list of BB isn't empty before "
"applying corresponding DTU updates.");
@@ -2238,7 +2238,7 @@ unsigned llvm::changeToUnreachable(Instruction *I, bool PreserveLCSSA,
while (BBI != BBE) {
if (!BBI->use_empty())
BBI->replaceAllUsesWith(PoisonValue::get(BBI->getType()));
- BB->getInstList().erase(BBI++);
+ BBI++->eraseFromParent();
++NumInstrsRemoved;
}
if (DTU) {
@@ -2308,7 +2308,7 @@ BasicBlock *llvm::changeToInvokeAndSplitBasicBlock(CallInst *CI,
CI->getName() + ".noexc");
// Delete the unconditional branch inserted by SplitBlock
- BB->getInstList().pop_back();
+ BB->back().eraseFromParent();
// Create the new invoke instruction.
SmallVector<Value *, 8> InvokeArgs(CI->args());
@@ -2336,7 +2336,7 @@ BasicBlock *llvm::changeToInvokeAndSplitBasicBlock(CallInst *CI,
CI->replaceAllUsesWith(II);
// Delete the original call
- Split->getInstList().pop_front();
+ Split->front().eraseFromParent();
return Split;
}