[llvm] [RemoveDIs] Add documentation for IR debug records (PR #81156)

J. Ryan Stinnett via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 13:47:06 PST 2024


================
@@ -12664,6 +12668,29 @@ Example:
 
       %tok = cleanuppad within %cs []
 
+.. _debugrecords:
+
+Debug Records
+-----------------------
+
+Debug records appear interleaved with instructions, but are not instructions;
+they are used only to define debug information, and have no effect on generated
+code. They are distinguished from instructions by the use of a leading `#` and
+an extra level of indentation. As an example:
+
+.. code-block:: llvm
+
+  %inst1 = op1 %a, %b
+    #dbg_value(%inst1, !10, !DIExpression(), !11)
+  %inst2 = op2 %inst1, %c
+
+These debug records are an optional replacement for
+:ref:`debug intrinsics<dbg_intrinsics>`. Debug records will be output iff the
----------------
jryans wrote:

Maybe you were going for "if and only if", but I think it's clear enough to just use standard "if" here.

```suggestion
:ref:`debug intrinsics<dbg_intrinsics>`. Debug records will be output if the
```

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


More information about the llvm-commits mailing list