RewriterGen: properly handle zero-result ops
authorAlex Zinenko <zinenko@google.com>
Mon, 29 Jul 2019 21:12:15 +0000 (14:12 -0700)
committerjpienaar <jpienaar@google.com>
Tue, 30 Jul 2019 13:17:50 +0000 (06:17 -0700)
commitc7dab559bae8eeb0b14038aa592f9fb03025bcc1
treec650c25d65887887e744f26c9dcb33892cc096bf
parent395c70c600ac89401caf50c3219a3af3248b3d99
RewriterGen: properly handle zero-result ops

RewriterGen was emitting invalid C++ code if the pattern required to create a
zero-result operation due to the absence of a special case that would avoid
generating a spurious comma.  Handle this case.  Also add rewriter tests for
zero-argument operations.

PiperOrigin-RevId: 260576998
mlir/test/lib/TestDialect/TestOps.td
mlir/test/mlir-tblgen/pattern.mlir
mlir/tools/mlir-tblgen/RewriterGen.cpp