[TableGen] Fix convertFromStorage for OptionalAttr
authorLei Zhang <antiagainst@google.com>
Wed, 3 Apr 2019 17:48:07 +0000 (10:48 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Thu, 4 Apr 2019 01:36:19 +0000 (18:36 -0700)
commit3522c65d3b8a71b9bc3ffd7601539b9f4572c577
tree8773ebd60cf9618752bf1b82a19b3bd819c26bf9
parent5fb62b47c3d139a54ba681933551cb7154f0caa0
[TableGen] Fix convertFromStorage for OptionalAttr

    OptionalAttr is just wrapping around the actual attribute; so it should just use
    the actual attribute's `convertFromStorage` to read the value and wrap it around
    with `Optional<>` to return. Previously it was mandating how the actual attribute
    reads the value with `{0}.getValue()`.

--

PiperOrigin-RevId: 241762355
mlir/include/mlir/IR/OpBase.td
mlir/test/mlir-tblgen/op-attribute.td