================
@@ -1686,7 +1686,8 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordBefore(
   DbgInstPtr DbgInst = unwrap(Builder)->insertDeclare(
       unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
       unwrap<DIExpression>(Expr), unwrap<DILocation>(DL),
-      unwrap<Instruction>(Instr));
+      Instr ? InsertPosition(unwrap<Instruction>(Instr)->getIterator())
+            : nullptr);
----------------
OCHyams wrote:

Thanks for unpicking that.

> This is a messy situation and in this PR I tried to just keep that exactly 
> the same. What previously worked should still work. What previously didn't 
> work should still not work.

SGTM. I feel as though these functions should probably have asserts in them 
saying as such but that could reasonably be argued to be out of scope of the 
patch.

Patch LGTM to me too.

https://github.com/llvm/llvm-project/pull/126059
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to