[llvm] [LLVM-C] Add bindings to `Instruction::getDbgRecordRange()` (PR #107802)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 13 01:57:35 PDT 2024
================
@@ -3682,6 +3682,33 @@ 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.
+ *
+ * @see llvm::Instruction::getDbgRecordRange()
+ */
+LLVMDbgRecordRef LLVMGetFirstDbgRecord(LLVMValueRef Inst);
+
+/**
+ * Obtain the last debug record attached to an instruction.
+ *
+ * @see llvm::Instruction::getDbgRecordRange()
+ */
+LLVMDbgRecordRef LLVMGetLastDbgRecord(LLVMValueRef Inst);
+
+/**
+ * Advance a debug record iterator.
+ */
+LLVMDbgRecordRef LLVMGetNextDbgRecord(LLVMDbgRecordRef DbgRecord);
+
+/**
+ * Go backwards in a debug record iterator.
----------------
OCHyams wrote:
Since there are already other changes to make here, I'll raise the nit: "Go backwards using" reads better than "Go backwards in" imo. Or rewording it to something like "Get the next DbgRecord or NULL."
https://github.com/llvm/llvm-project/pull/107802
More information about the llvm-commits
mailing list