[mlir][ods] Default-valued parameters in attribute or type defs
authorMogball <jeffniu22@gmail.com>
Tue, 15 Feb 2022 19:00:12 +0000 (19:00 +0000)
committerMogball <jeffniu22@gmail.com>
Tue, 15 Feb 2022 19:02:11 +0000 (19:02 +0000)
commit761bc83af4ee70c6c5156f73ed88947a5d9f013f
tree9066b9662a3c31b7bf6056cd881677780879ea81
parent3940f1e2372c69e04f50f86bcfc1182a1549ec32
[mlir][ods] Default-valued parameters in attribute or type defs

Optional parameters with `defaultValue` set will be populated with that value if they aren't encountered during parsing. Moreover, parameters equal to their default values are elided when printing.

Depends on D118210

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D118544
mlir/docs/Tutorials/DefiningAttributesAndTypes.md
mlir/include/mlir/IR/OpBase.td
mlir/include/mlir/TableGen/AttrOrTypeDef.h
mlir/lib/TableGen/AttrOrTypeDef.cpp
mlir/test/lib/Dialect/Test/TestTypeDefs.td
mlir/test/mlir-tblgen/attr-or-type-format-roundtrip.mlir
mlir/test/mlir-tblgen/attr-or-type-format.td
mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp