[clang] [llvm] [IRBuilder] Drop redundant BB argument for insert point ctor (PR #229052)

Antonio Frighetto via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 5 04:54:03 PDT 2026


================
@@ -2930,19 +2930,32 @@ class IRBuilder : public IRBuilderBase {
     SetInsertPoint(IP);
   }
 
-  // TODO: Remove BasicBlock argument.
+  // TODO: Deprecate this method.
   IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP, FolderTy Folder)
       : IRBuilderBase(TheBB->getContext(), this->Folder, this->Inserter),
         Folder(Folder) {
     SetInsertPoint(IP);
   }
 
-  // TODO: Remove BasicBlock argument.
+  // TODO: Deprecate this method.
   IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP)
       : IRBuilderBase(TheBB->getContext(), this->Folder, this->Inserter) {
     SetInsertPoint(IP);
   }
 
+  IRBuilder(BasicBlock::iterator IP, FolderTy Folder)
+      : IRBuilderBase(IP.getNodeParent()->getContext(), this->Folder,
+                      this->Inserter),
+        Folder(Folder) {
+    SetInsertPoint(IP);
+  }
+
+  IRBuilder(BasicBlock::iterator IP)
----------------
antoniofrighetto wrote:

```suggestion
  explicit IRBuilder(BasicBlock::iterator IP)
```

https://github.com/llvm/llvm-project/pull/229052


More information about the cfe-commits mailing list