Skip to content

Commit d0b7633

Browse files
authored
[mlir] [doc] fix typos in documentation (#120179)
This PR fixes typos within documentation in various files. Most changes are trivial. The one interesting change is the documentation for `custom<X>` in `assemblyFormat` that used the wrong return type. The return type from the `parseX` function should be `ParseResult` rather than `LogicalResult`. The `ParseResult` type is necessary due to tablegen generating code like the following within an Op `parse()` function: ``` auto odsResult = parseInferredArrayType(parser, elementsTypes, elementsOperands, resultRawTypes[0]); if (odsResult) return ::mlir::failure(); ``` This will fail to compile if `parseInferredArrayType()` returns `LogicalResult`. See also `parsePrettyLLVMType()` in LLVMTypes.h, `parseSingleBlockRegion()` in IRDL.cpp, `parseDynamicIndexList()` in ViewLikeInterface.cpp, etc.
1 parent 53d080c commit d0b7633

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
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

mlir/docs/PatternRewriter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ Passes that utilize rewrite patterns should aim to provide a common set of
464464
options and toggles to simplify the debugging experience when switching between
465465
different passes/projects/etc. To aid in this endeavor, MLIR provides a common
466466
set of utilities that can be easily included when defining a custom pass. These
467-
are defined in `mlir/RewritePassUtil.td`; an example usage is shown below:
467+
are defined in `mlir/Rewrite/PassUtil.td`; an example usage is shown below:
468468
469469
```tablegen
470470
def MyRewritePass : Pass<"..."> {

mlir/docs/SymbolsAndSymbolTables.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ into the system.
2121
The `Symbol` infrastructure essentially provides a non-SSA mechanism in which to
2222
refer to an operation symbolically with a name. This allows for referring to
2323
operations defined above regions that were defined as `IsolatedFromAbove` in a
24-
safe way. It also allows for symbolically referencing operations define below
24+
safe way. It also allows for symbolically referencing operations defined below
2525
other regions as well.
2626

2727
## Symbol
2828

2929
A `Symbol` is a named operation that resides immediately within a region that
3030
defines a [`SymbolTable`](#symbol-table). The name of a symbol *must* be unique
31-
within the parent `SymbolTable`. This name is semantically similarly to an SSA
31+
within the parent `SymbolTable`. This name is semantically similar to an SSA
3232
result value, and may be referred to by other operations to provide a symbolic
3333
link, or use, to the symbol. An example of a `Symbol` operation is
3434
[`func.func`](Dialects/Builtin.md/#func-mlirfuncop). `func.func` defines a
@@ -125,7 +125,7 @@ Using an attribute, as opposed to an SSA value, has several benefits:
125125

126126
- If we were to use SSA values, we would need to create some mechanism in
127127
which to opt-out of certain properties of it such as dominance.
128-
Attributes allow for referencing the operations irregardless of the
128+
Attributes allow for referencing the operations regardless of the
129129
order in which they were defined.
130130
- Attributes simplify referencing operations within nested symbol tables,
131131
which are traditionally not visible outside of the parent region.

mlir/include/mlir/IR/DialectImplementation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct FieldParser<
8989
}
9090
};
9191

92-
/// Parse an attribute.
92+
/// Parse a type.
9393
template <typename TypeT>
9494
struct FieldParser<
9595
TypeT, std::enable_if_t<std::is_base_of<Type, TypeT>::value, TypeT>> {

mlir/include/mlir/IR/OpBase.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ class Op<Dialect dialect, string mnemonic, list<Trait> props = []> {
401401
// an additional `LogicalResult verify()` declaration will be generated on the
402402
// operation class. The operation should implement this method and verify the
403403
// additional necessary invariants. This verifier shouldn't access any nested
404-
// operations because those operations may ill-formed. Use the
404+
// operations because those operations may be ill-formed. Use the
405405
// `hasRegionVerifier` below instead.
406406
bit hasVerifier = 0;
407407

mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ LogicalResult MlirOptMain(int argc, char **argv, llvm::StringRef toolName,
325325
DialectRegistry &registry);
326326

327327
/// Implementation for tools like `mlir-opt`.
328-
/// This function can be used with registrationAndParseCLIOptions so that
328+
/// This function can be used with registerAndParseCLIOptions so that
329329
/// CLI options can be accessed before running MlirOptMain.
330330
/// - inputFilename is the name of the input mlir file.
331331
/// - outputFilename is the name of the output file.

0 commit comments

Comments
 (0)