File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ class CadencePassAttribute:
35
35
ALL_CADENCE_PASSES : dict [ExportPass , CadencePassAttribute ] = {}
36
36
37
37
38
- def get_cadence_pass_attribute (p : ExportPass ) -> CadencePassAttribute :
39
- return ALL_CADENCE_PASSES [ p ]
38
+ def get_cadence_pass_attribute (p : ExportPass ) -> Optional [ CadencePassAttribute ] :
39
+ return ALL_CADENCE_PASSES . get ( p , None )
40
40
41
41
42
42
# A decorator that registers a pass.
@@ -61,7 +61,8 @@ def create_cadence_pass_filter(
61
61
def _filter (p : ExportPass ) -> bool :
62
62
pass_attribute = get_cadence_pass_attribute (p )
63
63
return (
64
- pass_attribute .opt_level is not None
64
+ pass_attribute is not None
65
+ and pass_attribute .opt_level is not None
65
66
and pass_attribute .opt_level <= opt_level
66
67
and (not pass_attribute .debug_pass or debug )
67
68
)
You can’t perform that action at this time.
0 commit comments