mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-21 18:16:54 +00:00
[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
This commit is contained in:
parent
949e4041c9
commit
d25becaa20
@ -809,11 +809,6 @@ def MyPass : Pass<"my-pass", "ModuleOp"> {
|
||||
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 @@ struct MyPassOptions {
|
||||
#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 @@ struct MyPass : foo::impl::MyPassBase<MyPass> {
|
||||
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 @@ contains the following fields:
|
||||
* `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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user