Skip to content

Commit 4c5469e

Browse files
author
Vasileios Porpodas
committed
[NFC] Replaces: BB->getInstList().erase(I) with I->eraseFromParent().
Differential Revision: https://reviews.llvm.org/D138976
1 parent 119f977 commit 4c5469e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,8 @@ bool TailRecursionEliminator::eliminateCall(CallInst *CI) {
716716
BranchInst *NewBI = BranchInst::Create(HeaderBB, Ret);
717717
NewBI->setDebugLoc(CI->getDebugLoc());
718718

719-
BB->getInstList().erase(Ret); // Remove return.
720-
BB->getInstList().erase(CI); // Remove call.
719+
Ret->eraseFromParent(); // Remove return.
720+
CI->eraseFromParent(); // Remove call.
721721
DTU.applyUpdates({{DominatorTree::Insert, BB, HeaderBB}});
722722
++NumEliminated;
723723
return true;

0 commit comments

Comments
 (0)