[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 19 06:17:23 PDT 2024
================
@@ -63,10 +63,10 @@ class IRBuilderDefaultInserter {
virtual ~IRBuilderDefaultInserter();
virtual void InsertHelper(Instruction *I, const Twine &Name,
- BasicBlock *BB,
BasicBlock::iterator InsertPt) const {
- if (BB)
- I->insertInto(BB, InsertPt);
+ if (InsertPt.isValid()) {
+ I->insertInto(InsertPt.getNodeParent(), InsertPt);
----------------
nikic wrote:
We should drop the BasicBlock argument from this API now, but that can be a followup...
https://github.com/llvm/llvm-project/pull/94226
More information about the cfe-commits
mailing list