HomePhabricator

[mlir][OpFormatGen] Add support for specifiy "custom" directives.

Authored by rriddle on Aug 31 2020, 12:33 PM.

Description

[mlir][OpFormatGen] Add support for specifiy "custom" directives.

This revision adds support for custom directives to the declarative assembly format. This allows for users to use C++ for printing and parsing subsections of an otherwise declaratively specified format. The custom directive is structured as follows:

custom-directive ::= `custom` `<` UserDirective `>` `(` Params `)`

user-directive is used as a suffix when this directive is used during printing and parsing. When parsing, parseUserDirective will be invoked. When printing, printUserDirective will be invoked. The first parameter to these methods must be a reference to either the OpAsmParser, or OpAsmPrinter. The type of rest of the parameters is dependent on the Params specified in the assembly format.

Differential Revision: https://reviews.llvm.org/D84719

Details

Committed
rriddleAug 31 2020, 1:26 PM
Differential Revision
D84719: [mlir][OpFormatGen] Add support for specifiy "custom" directives.
Parents
rG61e15ecab509: [docs] Fix indentation in FileCheck.rst
Branches
Unknown
Tags
Unknown