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

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 04:36:28 PDT 2023


fpetrogalli added a comment.

@tra - please find the alternative implementation that uses UnaryOp at D157492 <https://reviews.llvm.org/D157492>

To reiterate on my argument for preferring the current implementation, consider the first few lines of the uni test.

In this current patch, we have:

  defvar a = 1;
  defvar b = !add(!dump("a = ", a), 1);
  dump "b = ", b;
  // CHECK-LABEL: a = 1
  // CHECK-LABEL: b = 2

In the unary op implementation, we have:

  defvar a = 1111;
  defvar b = !add(!dump( a), 1);
  dump  b;
  // CHECK-LABEL: 1111
  // CHECK-LABEL: 1112

I think that the first version is more useful for debugging: one command allows to label the variable we are debugging in the (potentially thousands) of lines of output of tablegen.


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