Change elements literal parsing to not rely on shaped type being a vector or...
authorGeoffrey Martin-Noble <gcmn@google.com>
Wed, 29 May 2019 20:46:41 +0000 (13:46 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Sun, 2 Jun 2019 03:08:22 +0000 (20:08 -0700)
commit16ebc48c9d197fccbc57948215091f80519375d1
tree8fbae8bd2143b6f772a9e27e8c1be23a2b780137
parent1ebbb135cc51acc875be14e71c23503859b673b9
Change elements literal parsing to not rely on shaped type being a vector or tensor.

    This is in preparation for making MemRef a ShapedType. In general, a shaped type should be anything with shape, rank, and element type properties, so use sites shouldn't assume more than that.

    I also pulled the trailing comma parsing out the parseElementsLiteralType (new name) method. It seems weird to have the method parse the type + a trailing comma, even if all call sites currently need that. It's surprising behavior without looking at the implementation.

--

PiperOrigin-RevId: 250558363
mlir/lib/Parser/Parser.cpp
mlir/test/IR/invalid.mlir