Skip to content

Commit 09aa5af

Browse files
Update Print struct member variable names.
Signed-off-by: Tomas Fabrizio Orsi <[email protected]>
1 parent 21aa490 commit 09aa5af

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

hir/src/pass.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use crate::{
2424
/// A `Pass` which prints IR it is run on, based on provided configuration.
2525
#[derive(Default)]
2626
pub struct Print {
27-
filter: Option<OpFilter>,
28-
pass_filter: Option<SelectedPasses>,
27+
op_filter: Option<OpFilter>,
28+
selected_passes: Option<SelectedPasses>,
2929
target: Option<compact_str::CompactString>,
3030
only_when_modified: bool,
3131
}
@@ -71,14 +71,14 @@ impl Print {
7171
pub fn with_type_filter<T: crate::OpRegistration>(mut self) -> Self {
7272
let dialect = <T as crate::OpRegistration>::dialect_name();
7373
let op = <T as crate::OpRegistration>::name();
74-
self.filter = Some(OpFilter::Type { dialect, op });
74+
self.op_filter = Some(OpFilter::Type { dialect, op });
7575
self
7676
}
7777

7878
#[allow(dead_code)]
7979
/// Create a printer that only prints `Symbol` operations containing `name`
8080
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)));
8282
self
8383
}
8484

@@ -90,16 +90,16 @@ impl Print {
9090
}
9191

9292
fn with_all_symbols(mut self) -> Self {
93-
self.filter = Some(OpFilter::All);
93+
self.op_filter = Some(OpFilter::All);
9494
self
9595
}
9696

9797
fn with_pass_filter(mut self, config: &IRPrintingConfig) -> Self {
9898
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);
100100
true
101101
} 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()));
103103
true
104104
} else {
105105
false
@@ -111,7 +111,7 @@ impl Print {
111111
// any IR pass filter flag; then we assume that the desired behavior is to set the "all
112112
// pass" filter.
113113
if !is_ir_filter_set {
114-
self.pass_filter = Some(SelectedPasses::All);
114+
self.selected_passes = Some(SelectedPasses::All);
115115
}
116116
};
117117

@@ -129,7 +129,7 @@ impl Print {
129129
}
130130

131131
fn print_ir(&self, op: EntityRef<'_, Operation>) {
132-
match self.filter {
132+
match self.op_filter {
133133
Some(OpFilter::All) => {
134134
let target = self.target.as_deref().unwrap_or("printer");
135135
log::trace!(target: target, "{op}");
@@ -163,7 +163,7 @@ impl Print {
163163
}
164164

165165
fn pass_filter(&self, pass: &dyn OperationPass) -> bool {
166-
match &self.pass_filter {
166+
match &self.selected_passes {
167167
Some(SelectedPasses::All) => true,
168168
Some(SelectedPasses::Just(passes)) => passes.iter().any(|p| {
169169
if let Some(p_type) = pass.pass_id() {

0 commit comments

Comments
 (0)