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);
Can you add an example for say, a StringRef? It would be nice to have more complex/non-primitive test cases. StringRef as before is a good one, and so would something that is "expensive" to copy/non-trivially copyable/etc.