@@ -24,8 +24,8 @@ use crate::{
24
24
/// A `Pass` which prints IR it is run on, based on provided configuration.
25
25
#[ derive( Default ) ]
26
26
pub struct Print {
27
- filter : Option < OpFilter > ,
28
- pass_filter : Option < SelectedPasses > ,
27
+ op_filter : Option < OpFilter > ,
28
+ selected_passes : Option < SelectedPasses > ,
29
29
target : Option < compact_str:: CompactString > ,
30
30
only_when_modified : bool ,
31
31
}
@@ -71,14 +71,14 @@ impl Print {
71
71
pub fn with_type_filter < T : crate :: OpRegistration > ( mut self ) -> Self {
72
72
let dialect = <T as crate :: OpRegistration >:: dialect_name ( ) ;
73
73
let op = <T as crate :: OpRegistration >:: name ( ) ;
74
- self . filter = Some ( OpFilter :: Type { dialect, op } ) ;
74
+ self . op_filter = Some ( OpFilter :: Type { dialect, op } ) ;
75
75
self
76
76
}
77
77
78
78
#[ allow( dead_code) ]
79
79
/// Create a printer that only prints `Symbol` operations containing `name`
80
80
fn with_symbol_matching ( mut self , name : & ' static str ) -> Self {
81
- self . filter = Some ( OpFilter :: Symbol ( Some ( name) ) ) ;
81
+ self . op_filter = Some ( OpFilter :: Symbol ( Some ( name) ) ) ;
82
82
self
83
83
}
84
84
@@ -90,16 +90,16 @@ impl Print {
90
90
}
91
91
92
92
fn with_all_symbols ( mut self ) -> Self {
93
- self . filter = Some ( OpFilter :: All ) ;
93
+ self . op_filter = Some ( OpFilter :: All ) ;
94
94
self
95
95
}
96
96
97
97
fn with_pass_filter ( mut self , config : & IRPrintingConfig ) -> Self {
98
98
let is_ir_filter_set = if config. print_ir_after_all {
99
- self . pass_filter = Some ( SelectedPasses :: All ) ;
99
+ self . selected_passes = Some ( SelectedPasses :: All ) ;
100
100
true
101
101
} else if !config. print_ir_after_pass . is_empty ( ) {
102
- self . pass_filter = Some ( SelectedPasses :: Just ( config. print_ir_after_pass . clone ( ) ) ) ;
102
+ self . selected_passes = Some ( SelectedPasses :: Just ( config. print_ir_after_pass . clone ( ) ) ) ;
103
103
true
104
104
} else {
105
105
false
@@ -111,7 +111,7 @@ impl Print {
111
111
// any IR pass filter flag; then we assume that the desired behavior is to set the "all
112
112
// pass" filter.
113
113
if !is_ir_filter_set {
114
- self . pass_filter = Some ( SelectedPasses :: All ) ;
114
+ self . selected_passes = Some ( SelectedPasses :: All ) ;
115
115
}
116
116
} ;
117
117
@@ -129,7 +129,7 @@ impl Print {
129
129
}
130
130
131
131
fn print_ir ( & self , op : EntityRef < ' _ , Operation > ) {
132
- match self . filter {
132
+ match self . op_filter {
133
133
Some ( OpFilter :: All ) => {
134
134
let target = self . target . as_deref ( ) . unwrap_or ( "printer" ) ;
135
135
log:: trace!( target: target, "{op}" ) ;
@@ -163,7 +163,7 @@ impl Print {
163
163
}
164
164
165
165
fn pass_filter ( & self , pass : & dyn OperationPass ) -> bool {
166
- match & self . pass_filter {
166
+ match & self . selected_passes {
167
167
Some ( SelectedPasses :: All ) => true ,
168
168
Some ( SelectedPasses :: Just ( passes) ) => passes. iter ( ) . any ( |p| {
169
169
if let Some ( p_type) = pass. pass_id ( ) {
0 commit comments