[OpAsmParser] Add a parseCommaSeparatedList helper and beef up Delimeter.
authorChris Lattner <clattner@nondot.org>
Tue, 21 Sep 2021 01:27:40 +0000 (18:27 -0700)
committerChris Lattner <clattner@nondot.org>
Tue, 21 Sep 2021 03:59:11 +0000 (20:59 -0700)
commit58abc8c34bde7021bbfa0a7bdfd2af9524cba263
treeb34728eaac832f347dc847ef32d9cbbff2953dfa
parent073b254cffeffdef36ffbee0c9afdc0da9cd6ac3
[OpAsmParser] Add a parseCommaSeparatedList helper and beef up Delimeter.

Lots of custom ops have hand-rolled comma-delimited parsing loops, as does
the MLIR parser itself.  Provides a standard interface for doing this that
is less error prone and less boilerplate.

While here, extend Delimiter to support <> and {} delimited sequences as
well (I have a use for <> in CIRCT specifically).

Differential Revision: https://reviews.llvm.org/D110122
13 files changed:
mlir/include/mlir/IR/OpImplementation.h
mlir/lib/Dialect/Async/IR/Async.cpp
mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
mlir/lib/Parser/AffineParser.cpp
mlir/lib/Parser/AttributeParser.cpp
mlir/lib/Parser/LocationParser.cpp
mlir/lib/Parser/Parser.cpp
mlir/lib/Parser/Parser.h
mlir/lib/Parser/TypeParser.cpp
mlir/test/IR/invalid-affinemap.mlir
mlir/test/IR/invalid.mlir