Example of using ODS parameter classes:
-```
+```tablegen
def MyParameter : TypeParameter<"std::pair<int, int>", "pair of ints"> {
let printer = [{ $_printer << $_self.first << " * " << $_self.second }];
let parser = [{ [&] -> FailureOr<std::pair<int, int>> {
For example:
-```
+```tablegen
let parameters = (ins DefaultValuedParameter<"Optional<int>", "5">:$a)
let mnemonic = "default_valued";
let assemblyFormat = "(`<` $a^ `>`)?";
Which will look like:
-```
+```mlir
!test.default_valued // a = 5
!test.default_valued<10> // a = 10
```
For optional `Attribute` or `Type` parameters, the current MLIR context is
available through `$_ctx`. E.g.
-```
+```tablegen
DefaultValuedParameter<"IntegerType", "IntegerType::get($_ctx, 32)">
```
For example, a data layout specification may be an actual list of pairs with
simple custom syntax resembling the following:
-```
+```mlir
#my_dialect.layout_spec<
#my_dialect.layout_entry<!my_dialect.type, size=42>,
#my_dialect.layout_entry<"my_dialect.endianness", "little">,
e.g., `memref` operations. Its data layout is parameterized by a single integer
data layout entry that specifies its bitwidth. For example,
-```
+```mlir
module attributes { dlti.dl_spec = #dlti.dl_spec<
#dlti.dl_entry<index, 32>
>} {}
Examples:
-~~~tablegen
+```tablegen
def MyInterface : OpInterface<"MyInterface"> {
let description = [{
This is the description of the interface. It provides concrete information
// the generation of a declaration for those methods.
def OpWithOverrideInferTypeInterfaceOp : Op<...
[DeclareOpInterfaceMethods<MyInterface, ["getNumWithDefault"]>]> { ... }
-~~~
+```
Note: Existing operation interfaces defined in C++ can be accessed in the ODS
framework via the `OpInterfaceTrait` class.
Classes/defs can be marked as deprecated by using the `Deprecate` helper class,
e.g.,
-```td
+```tablegen
def OpTraitA : NativeOpTrait<"OpTraitA">, Deprecated<"use `bar` instead">;
```
For example, the following `.mlir`:
-```
+```mlir
module {
spv.module "Logical" "GLSL450" {
func @foo() {