[PATCH] D139143: [NFC] Cleanup: Replaces BB->getInstList().erase() with BB->erase().

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 13:57:56 PST 2022


vporpo created this revision.
vporpo added reviewers: aeubanks, asbirlea.
Herald added subscribers: pmatos, asb, hiraditya, sbc100.
Herald added a project: All.
vporpo requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.

This is part of a series of cleanup patches towards making BasicBlock::getInstList() private.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139143

Files:
  llvm/lib/CodeGen/WasmEHPrepare.cpp


Index: llvm/lib/CodeGen/WasmEHPrepare.cpp
===================================================================
--- llvm/lib/CodeGen/WasmEHPrepare.cpp
+++ llvm/lib/CodeGen/WasmEHPrepare.cpp
@@ -182,8 +182,7 @@
     Changed = true;
     auto *BB = ThrowI->getParent();
     SmallVector<BasicBlock *, 4> Succs(successors(BB));
-    auto &InstList = BB->getInstList();
-    InstList.erase(std::next(BasicBlock::iterator(ThrowI)), InstList.end());
+    BB->erase(std::next(BasicBlock::iterator(ThrowI)), BB->end());
     IRB.SetInsertPoint(BB);
     IRB.CreateUnreachable();
     eraseDeadBBsAndChildren(Succs);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139143.479422.patch
Type: text/x-patch
Size: 606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221201/9e1251f0/attachment.bin>


More information about the llvm-commits mailing list