Fix bug for Ops with default valued attributes and successors/variadic regions.
authorTyler Augustine <taugustine@google.com>
Wed, 22 Sep 2021 20:44:02 +0000 (20:44 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 22 Sep 2021 21:22:31 +0000 (21:22 +0000)
commitcd36bab4ca901199c753e99cb66143eca52ffed8
tree848184560ac16c3f42eb41b9cf9b60cf891e89d8
parent423d34f74a10ae122a67a18a76c2ead6e26924eb
Fix bug for Ops with default valued attributes and successors/variadic regions.

When both a DefaultValuedAttr and a successor or variadic region was specified, this would generate invalid C++ declaration. There would be the parameter with a default value, followed by the successors/regions, which don't have a default, which is invalid.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D110205
mlir/test/mlir-tblgen/op-attribute.td
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp