[MLIR][Doc] Update the pass infra doc to advise against `let constructor = ` (NFC)
We should avoid specifying it manually and instead rely on TableGen, see also
cleanups in #127403
diff --git a/mlir/docs/PassManagement.md b/mlir/docs/PassManagement.md
index 9fb0aaa..eda48a4 100644
--- a/mlir/docs/PassManagement.md
+++ b/mlir/docs/PassManagement.md
@@ -809,11 +809,6 @@
its various constraints and behavior.
}];
- // A constructor must be provided to specify how to create a default instance
- // of MyPass. It can be skipped for this specific example, because both the
- // constructor and the registration methods live in the same namespace.
- let constructor = "foo::createMyPass()";
-
// Specify any options.
let options = [
Option<"option", "example-option", "bool", /*default=*/"true",
@@ -883,8 +878,7 @@
#endif // GEN_PASS_DECL_MYPASS
```
-If the `constructor` field has not been specified in the tablegen declaration,
-then autogenerated file will also contain the declarations of the default
+The utogenerated file will also contain the declarations of the default
constructors.
```c++
@@ -927,9 +921,8 @@
These definitions can be enabled on a per-pass basis by defining the appropriate
preprocessor `GEN_PASS_DEF_PASSNAME` macro, with `PASSNAME` equal to the
uppercase version of the name of the pass definition in tablegen.
-If the `constructor` field has not been specified in tablegen, then the default
-constructors are also defined and expect the name of the actual pass class to
-be equal to the name defined in tablegen.
+The default constructors are also defined and expect the name of the actual pass
+class to be equal to the name defined in tablegen.
Using the `gen-pass-doc` generator, markdown documentation for each of the
passes can be generated. See [Passes.md](Passes.md) for example output of real
@@ -951,12 +944,14 @@
* `dependentDialects`
- A list of strings representing the `Dialect` classes this pass may
introduce entities, Attributes/Operations/Types/etc., of.
-* `constructor`
- - A code block used to create a default instance of the pass.
* `options`
- A list of pass options used by the pass.
* `statistics`
- A list of pass statistics used by the pass.
+* `constructor`
+ - A code block used to create a default instance of the pass.
+ Specifying it will disable the constructors auto-generation for the
+ pass. This is a legacy option, it is not advised to use it.
#### Options