[llvm] [LLVM-C] Add bindings to `Instruction::getDbgRecordRange()` (PR #107802)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 01:52:52 PDT 2024


================
@@ -3682,6 +3682,41 @@ LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst);
  */
 LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst);
 
+/**
+ * Obtain the first debug record attached to an instruction.
+ *
+ * The returned debug record can be used as an iterator. You will likely
+ * eventually call into LLVMGetNextDbgRecord() with it.
+ *
+ * Return the first DbgRecord attached to Inst or NULL if there are none.
+ *
+ * @see llvm::Instruction::getDbgRecordRange()
+ */
+LLVMDbgRecordRef LLVMGetFirstDbgRecord(LLVMValueRef Inst);
+
+/**
+ * Obtain the last debug record attached to an instruction.
+ *
+ * Return the last DbgRecord attached to Inst or NULL if there are none.
+ *
+ * @see llvm::Instruction::getDbgRecordRange()
+ */
+LLVMDbgRecordRef LLVMGetLastDbgRecord(LLVMValueRef Inst);
+
+/**
+ * Obtain the next DbgRecord in the iterator or NULL if there is none.
----------------
OCHyams wrote:

```suggestion
 * Obtain the next DbgRecord in the sequence or NULL if there are no more.
```

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


More information about the llvm-commits mailing list