[clang] [llvm] [mlir] [IRBuilder] Remove custom insertion point type (PR #228117)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 09:52:54 PDT 2026


================
@@ -200,11 +200,12 @@ class IRBuilderBase {
   }
 
   /// This specifies that created instructions should be inserted at
-  /// the specified point, but also requires that \p IP is dereferencable.
+  /// the specified point.
   void SetInsertPoint(BasicBlock::iterator IP) {
-    BB = IP->getParent();
+    BB = IP.getNodeParent();
     InsertPt = IP;
-    SetCurrentDebugLocation(IP->getStableDebugLoc());
+    if (IP != BB->end())
+      SetCurrentDebugLocation(IP->getStableDebugLoc());
----------------
nikic wrote:

Hm, I agree that this would make sense, but it's not done by the method above it, which is supposed to have the same behavior. Should probably change these together in a followup?

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


More information about the llvm-commits mailing list