[tablegen] Fixed few !foreach evaluation issues.
authorArtem Belevich <tra@google.com>
Fri, 9 Feb 2018 18:37:55 +0000 (18:37 +0000)
committerArtem Belevich <tra@google.com>
Fri, 9 Feb 2018 18:37:55 +0000 (18:37 +0000)
commitd75805e0e90366326a946a8c28174beae06b7f88
treecfacdde18428d7056c241fae7ec64de5c0034580
parent33ba93c2b5e6fd8a4d9663a9b50ace9e104ef50d
[tablegen] Fixed few !foreach evaluation issues.

* !foreach on lists didn't evaluate operands of the RHS operator.
  This made nested operators silently fail.
* A typo in the code could result in a wrong value substituted
  for an operation which produced a false '!foreach requires an operator' error.
* Keep recursion over the DAG within ForeachHelper. This simplifies
  things a bit as we no longer need to pass the Type around in order
  to prevent recursion.

Differential Revision: https://reviews.llvm.org/D43083

llvm-svn: 324758
llvm/lib/TableGen/Record.cpp
llvm/test/TableGen/foreach-eval.td [new file with mode: 0644]