[llvm] [Tablegen] Add keywork `dump`. (PR #68793)

Francesco Petrogalli via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 00:53:55 PDT 2023


================
@@ -1275,6 +1275,23 @@ be nested.
 This loop defines records named ``R0``, ``R1``, ``R2``, and ``R3``, along
 with ``F0``, ``F1``, ``F2``, and ``F3``.
 
+``dump`` --- print messages to stderr
+-------------------------------------
+
+A ``dump`` statement prints the input string to standard error
+output. It is intended for debugging purpose.
+
+.. productionlist::
+   Dump: "dump"  `string` ";"
+
+For example, it can be used in combination with `!repl` to investigate
+the values passed to a multiclass:
+
+.. code-block:: text
+
+  multiclass MC<dag s> {
+    dump "s = " # !repl(s);
----------------
fpetrogalli wrote:

```suggestion
    dump "s = " # !repr(s);
```

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


More information about the llvm-commits mailing list