[mlir][OpFormat] Add support for emitting newlines from the custom format of an operation
authorRiver Riddle <riddleriver@gmail.com>
Mon, 14 Dec 2020 19:53:34 +0000 (11:53 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Mon, 14 Dec 2020 20:00:43 +0000 (12:00 -0800)
commitc234b65cef07b38c91b9ab7dec6a35f8b390e658
tree408bd9084ed42ae04f0f32db52eaf63cbe57ca18
parent0936655bac78f6e9cb84dc3feb30c32012100839
[mlir][OpFormat] Add support for emitting newlines from the custom format of an operation

This revision adds a new `printNewline` hook to OpAsmPrinter that allows for printing a newline within the custom format of an operation, that is then indented to the start of the operation. Support for the declarative assembly format is also added, in the form of a `\n` literal.

Differential Revision: https://reviews.llvm.org/D93151
mlir/docs/OpDefinitions.md
mlir/include/mlir/IR/OpImplementation.h
mlir/lib/IR/AsmPrinter.cpp
mlir/test/lib/Dialect/Test/TestOps.td
mlir/test/mlir-tblgen/op-format-spec.td
mlir/test/mlir-tblgen/op-format.mlir
mlir/tools/mlir-tblgen/OpFormatGen.cpp