[Mlir-commits] [mlir] 29d990e - [mlir][ods] update attr/type def format docs
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Dec 2 15:43:04 PST 2021
Author: Mogball
Date: 2021-12-02T23:42:47Z
New Revision: 29d990e4395971794ab3304e450eed386402c1fa
URL: https://github.com/llvm/llvm-project/commit/29d990e4395971794ab3304e450eed386402c1fa
DIFF: https://github.com/llvm/llvm-project/commit/29d990e4395971794ab3304e450eed386402c1fa.diff
LOG: [mlir][ods] update attr/type def format docs
Added:
Modified:
mlir/docs/Tutorials/DefiningAttributesAndTypes.md
Removed:
################################################################################
diff --git a/mlir/docs/Tutorials/DefiningAttributesAndTypes.md b/mlir/docs/Tutorials/DefiningAttributesAndTypes.md
index 0f8edc5bf1ae7..8dcb678c2e035 100644
--- a/mlir/docs/Tutorials/DefiningAttributesAndTypes.md
+++ b/mlir/docs/Tutorials/DefiningAttributesAndTypes.md
@@ -422,14 +422,14 @@ in the IR:
### Parameter Parsing and Printing
For many basic parameter types, no additional work is needed to define how
-these parameters are parsed or printerd.
+these parameters are parsed or printed.
* The default printer for any parameter is `$_printer << $_self`,
- where `$_self` is the C++ value of the parameter and `$_printer` is a
- `DialectAsmPrinter`.
+ where `$_self` is the C++ value of the parameter and `$_printer` is an
+ `AsmPrinter`.
* The default parser for a parameter is
`FieldParser<$cppClass>::parse($_parser)`, where `$cppClass` is the C++ type
- of the parameter and `$_parser` is a `DialectAsmParser`.
+ of the parameter and `$_parser` is an `AsmParser`.
Printing and parsing behaviour can be added to additional C++ types by
overloading these functions or by defining a `parser` and `printer` in an ODS
@@ -440,12 +440,12 @@ Example of overloading:
```c++
using MyParameter = std::pair<int, int>;
-DialectAsmPrinter &operator<<(DialectAsmPrinter &printer, MyParameter param) {
+AsmPrinter &operator<<(AsmPrinter &printer, MyParameter param) {
printer << param.first << " * " << param.second;
}
template <> struct FieldParser<MyParameter> {
- static FailureOr<MyParameter> parse(DialectAsmParser &parser) {
+ static FailureOr<MyParameter> parse(AsmParser &parser) {
int a, b;
if (parser.parseInteger(a) || parser.parseStar() ||
parser.parseInteger(b))
More information about the Mlir-commits
mailing list