[TableGen] Add !setdagarg and !setdagname
authorMichael Liao <michael.hliao@gmail.com>
Wed, 31 May 2023 03:34:47 +0000 (23:34 -0400)
committerMichael Liao <michael.hliao@gmail.com>
Wed, 7 Jun 2023 13:37:40 +0000 (09:37 -0400)
commitdcc8f9490f790e7ecbe08a655abec272422df163
tree7f687fb7e340159870628358da644f81831cdbce
parent2011ad0cbbf52a6f3b7bf76aa40578d3ff9fd60d
[TableGen] Add !setdagarg and !setdagname

- This patch proposes to add `!setdagarg` and `!setdagname` bang
  operators to produce a new DAG node after replacing the specified
  argument value/name from the given input DAG node. E.g.,
  `!setdagarg((foo 1, 2), 0, "x")` produces `(foo "x", 2)` and
  `!setdagname((foo 1:$a, 2:$b), 1, "c")` produces `(foo 1:$a, 2:$c)`.

Reviewed By: simon_tatham

Differential Revision: https://reviews.llvm.org/D151842
llvm/docs/TableGen/ProgRef.rst
llvm/include/llvm/TableGen/Record.h
llvm/lib/TableGen/Record.cpp
llvm/lib/TableGen/TGLexer.cpp
llvm/lib/TableGen/TGLexer.h
llvm/lib/TableGen/TGParser.cpp
llvm/test/TableGen/getsetop.td