[PATCH] D140237: [IR][NFC] Add BasicBlock::erase(Instruction *I) for erasing a single Instruction.
Vasileios Porpodas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 16 12:07:59 PST 2022
vporpo added a comment.
It is exactly the same. There is no super strong reason for having both functions.
The main reason is that the BB behaves like a list as it implements begin(), end(), size(), splice() etc. so not having an erase(I) function looks strange.
Up until now one could simply do BB->getInstList().erase(I), instead of I->eraseFromParent(), so this function is covering this case.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140237/new/
https://reviews.llvm.org/D140237
More information about the llvm-commits
mailing list