[all-commits] [llvm/llvm-project] 4767e2: [mlir][ods] Add support for custom directive in at...
Jeff Niu via All-commits
all-commits at lists.llvm.org
Tue Mar 15 00:15:27 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4767e267757fa56d40248b759d7b17ac1c6fb2ef
https://github.com/llvm/llvm-project/commit/4767e267757fa56d40248b759d7b17ac1c6fb2ef
Author: Mogball <jeffniu22 at gmail.com>
Date: 2022-03-15 (Tue, 15 Mar 2022)
Changed paths:
M mlir/docs/Tutorials/DefiningAttributesAndTypes.md
M mlir/test/lib/Dialect/Test/TestTypeDefs.td
M mlir/test/lib/Dialect/Test/TestTypes.cpp
M mlir/test/mlir-tblgen/attr-or-type-format-invalid.td
M mlir/test/mlir-tblgen/attr-or-type-format-roundtrip.mlir
M mlir/test/mlir-tblgen/attr-or-type-format.td
M mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
M mlir/tools/mlir-tblgen/FormatGen.h
M mlir/tools/mlir-tblgen/OpFormatGen.cpp
Log Message:
-----------
[mlir][ods] Add support for custom directive in attr/type formats
This patch adds support for custom directives in attribute and type formats. Custom directives dispatch calls to user-defined parser and printer functions.
For example, the assembly format "custom<Foo>($foo, ref($bar))" expects a function with the signature
```
LogicalResult parseFoo(AsmParser &parser, FailureOr<FooT> &foo, BarT bar);
void printFoo(AsmPrinter &printer, FooT foo, BarT bar);
```
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D120944
More information about the All-commits
mailing list