Add `parseGenericOperation()` to the OpAsmParser
authorMehdi Amini <aminim@google.com>
Mon, 9 Sep 2019 06:39:34 +0000 (23:39 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 9 Sep 2019 06:40:12 +0000 (23:40 -0700)
commit42b60d34fc3dfbad2b26568cf1cd903685df3a3e
treed4d53b363e4063e10dc283aa46818cd1cf7d5bfd
parent120509a6b22b7532849e22c093b912ef4a1d0c73
Add `parseGenericOperation()` to the OpAsmParser

This method parses an operation in its generic form, from the current parser
state. This is the symmetric of OpAsmPrinter::printGenericOp(). An immediate
use case is illustrated in the test dialect, where an operation wraps another
one in its region and makes use of a single-line pretty-print form.

PiperOrigin-RevId: 267930869
mlir/include/mlir/IR/OpImplementation.h
mlir/lib/Parser/Parser.cpp
mlir/test/IR/wrapping_op.mlir [new file with mode: 0644]
mlir/test/lib/TestDialect/TestDialect.cpp
mlir/test/lib/TestDialect/TestOps.td