[PATCH] D156420: [TableGen] Add `!dump` and `dump`.

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 12:19:52 PDT 2023


tra added a comment.

Sorry about the silence -- I was away for the last couple of weeks.

Thank you very much for the patch!

In D156420#4541608 <https://reviews.llvm.org/D156420#4541608>, @wangpc wrote:

> Or loose the constraint that first operand shoule be a string? for your example, it can be simpler: `!dump(!format("the concat is = {0} {1}...", vars...))`. `XDump` can still be a binary operator and set second operand to `StringInit("")` when only one operand is provided.

In general the `dump(string, value)` API looks a bit too specialized. I would rather have a single-argument `!dump(value)` and, if a value needs some annotation, just use `!dump("annotation string"); !dump(value)`. Once we have `!format()` it would be a straightforward to transition to `!dump(!format("annotation...", value))`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156420/new/

https://reviews.llvm.org/D156420



More information about the llvm-commits mailing list