Skip to content

Commit 5c8f341

Browse files
committed
[mlir][docs] Explain required attributes for CallOpInterface in Toy tutorial (NFC)
Signed-off-by: Joshua James Venter <[email protected]>
1 parent 89d9a83 commit 5c8f341

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

mlir/docs/Tutorials/Toy/Ch-4.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,20 @@ def GenericCallOp : Toy_Op<"generic_call",
159159

160160
In the above we also use the `DeclareOpInterfaceMethods` directive to
161161
auto-declare all of the interface methods in the class declaration of
162-
GenericCallOp. We have already provided the definition in the `extraClassDeclaration`
162+
`GenericCallOp`. However, using this directive with `CallOpInterface`
163+
includes methods for handling argument and result attributes. Therefore,
164+
we need to add these specifically named attributes to our `GenericCallOp`
165+
definition:
166+
167+
```tablegen
168+
let arguments = (ins
169+
...
170+
OptionalAttr<DictArrayAttr>:$arg_attrs,
171+
OptionalAttr<DictArrayAttr>:$res_attrs
172+
);
173+
174+
175+
We have already provided the definition in the `extraClassDeclaration`
163176
field of the `FuncOp` class:
164177
165178
```c++

0 commit comments

Comments
 (0)