@@ -809,11 +809,6 @@ def MyPass : Pass<"my-pass", "ModuleOp"> {
809
809
its various constraints and behavior.
810
810
}];
811
811
812
- // A constructor must be provided to specify how to create a default instance
813
- // of MyPass. It can be skipped for this specific example, because both the
814
- // constructor and the registration methods live in the same namespace.
815
- let constructor = "foo::createMyPass()";
816
-
817
812
// Specify any options.
818
813
let options = [
819
814
Option<"option", "example-option", "bool", /*default=*/"true",
@@ -883,8 +878,7 @@ struct MyPassOptions {
883
878
#endif // GEN_PASS_DECL_MYPASS
884
879
```
885
880
886
- If the ` constructor ` field has not been specified in the tablegen declaration,
887
- then autogenerated file will also contain the declarations of the default
881
+ The utogenerated file will also contain the declarations of the default
888
882
constructors.
889
883
890
884
``` c++
@@ -927,9 +921,8 @@ struct MyPass : foo::impl::MyPassBase<MyPass> {
927
921
These definitions can be enabled on a per-pass basis by defining the appropriate
928
922
preprocessor `GEN_PASS_DEF_PASSNAME` macro, with `PASSNAME` equal to the
929
923
uppercase version of the name of the pass definition in tablegen.
930
- If the `constructor` field has not been specified in tablegen, then the default
931
- constructors are also defined and expect the name of the actual pass class to
932
- be equal to the name defined in tablegen.
924
+ The default constructors are also defined and expect the name of the actual pass
925
+ class to be equal to the name defined in tablegen.
933
926
934
927
Using the `gen-pass-doc` generator, markdown documentation for each of the
935
928
passes can be generated. See [Passes.md](Passes.md) for example output of real
@@ -951,12 +944,14 @@ contains the following fields:
951
944
* `dependentDialects`
952
945
- A list of strings representing the `Dialect` classes this pass may
953
946
introduce entities, Attributes/Operations/Types/etc., of.
954
- * `constructor`
955
- - A code block used to create a default instance of the pass.
956
947
* `options`
957
948
- A list of pass options used by the pass.
958
949
* `statistics`
959
950
- A list of pass statistics used by the pass.
951
+ * `constructor`
952
+ - A code block used to create a default instance of the pass.
953
+ Specifying it will disable the constructors auto-generation for the
954
+ pass. This is a legacy option, it is not advised to use it.
960
955
961
956
#### Options
962
957
0 commit comments