Skip to content

Commit f43369a

Browse files
committed
fix: documentation for custom parsing
Documentation for `custom<X>` in `assemblyFormat` used the wrong return type. See `parsePrettyLLVMType()` in LLVMTypes.h, `parseSingleBlockRegion()` in IRDL.cpp, `parseDynamicIndexList()` in ViewLikeInterface.cpp, etc.
1 parent 411d7c1 commit f43369a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mlir/docs/DefiningDialects/AttributesAndTypes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ The `custom` directive `custom<Foo>($foo)` will in the parser and printer
890890
respectively generate calls to:
891891

892892
```c++
893-
LogicalResult parseFoo(AsmParser &parser, int &foo);
893+
ParseResult parseFoo(AsmParser &parser, int &foo);
894894
void printFoo(AsmPrinter &printer, int foo);
895895
```
896896
@@ -907,7 +907,7 @@ let assemblyFormat = "custom<Fizz>($foobar)";
907907
It will generate calls expecting the following signature for `parseFizz`:
908908

909909
```c++
910-
LogicalResult parseFizz(AsmParser &parser, FailureOr<NotDefaultConstructible> &foobar);
910+
ParseResult parseFizz(AsmParser &parser, FailureOr<NotDefaultConstructible> &foobar);
911911
```
912912
913913
A previously bound variable can be passed as a parameter to a `custom` directive
@@ -916,7 +916,7 @@ the first directive. The second directive references it and expects the
916916
following printer and parser signatures:
917917
918918
```c++
919-
LogicalResult parseBar(AsmParser &parser, int &bar, int foo);
919+
ParseResult parseBar(AsmParser &parser, int &bar, int foo);
920920
void printBar(AsmPrinter &printer, int bar, int foo);
921921
```
922922

@@ -925,7 +925,7 @@ is that the parameter for the parser must use the storage type of the parameter.
925925
For example, `StringRefParameter` expects the parser and printer signatures as:
926926

927927
```c++
928-
LogicalResult parseStringParam(AsmParser &parser, std::string &value);
928+
ParseResult parseStringParam(AsmParser &parser, std::string &value);
929929
void printStringParam(AsmPrinter &printer, StringRef value);
930930
```
931931

0 commit comments

Comments
 (0)