Skip to content

Commit 1076b01

Browse files
committed
XXX: disable debug printing
1 parent efbe288 commit 1076b01

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

compiler/rustc_monomorphize/src/partitioning/default.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,23 @@ impl<'tcx> Partition<'tcx> for DefaultPartitioning {
117117
// njn: type ann?
118118
let total_size: usize = codegen_units.iter().map(|cgu| cgu.size_estimate()).sum();
119119
let target_size = total_size / cx.target_cgu_count;
120-
eprintln!("----");
121-
eprintln!("SPLIT0: total:{} target:{}", total_size, target_size);
120+
//eprintln!("----");
121+
//eprintln!("SPLIT0: total:{} target:{}", total_size, target_size);
122122
// njn: need a while loop because we're modifying codegen_units as we go
123123
// njn: make it a for loop?
124124
// njn: explain all this
125125
let mut i = 0;
126126
let mut j = 0; // njn: explain
127127
let n = codegen_units.len();
128128
while i < n {
129-
let old_cgu = &mut codegen_units[i];
129+
let old_cgu = &mut codegen_units[i];
130130
if old_cgu.size_estimate() > target_size && old_cgu.items().len() > 1 {
131-
eprintln!("SPLIT1: old:{} old:{}", old_cgu.size_estimate(), old_cgu.name());
131+
//eprintln!("SPLIT1: old:{} old:{}", old_cgu.size_estimate(), old_cgu.name());
132132

133133
// njn: too big; split
134134
// njn: explain how a very big CGU will be split multiple
135135
// times
136-
136+
137137
let mut new_name = old_cgu.name().to_string();
138138
new_name += &format!("-split{}", j);
139139
let mut new_cgu = CodegenUnit::new(Symbol::intern(&new_name));
@@ -144,13 +144,17 @@ impl<'tcx> Partition<'tcx> for DefaultPartitioning {
144144

145145
// njn: what if this empties old_cgu?
146146

147+
// njn: non-deterministic iteration results in
148+
// non-deterministic splitting, which messes up incremental
149+
// compilation
150+
147151
// njn: nicer way to do this?
148152
// njn: don't move if it's the last item
149153
old_cgu.items_mut().drain_filter(|item, rest| {
150154
// njn: true->remove
151155
if moved_size < target_size {
152156
let item_size = item.size_estimate(cx.tcx);
153-
eprintln!("MOVE: {}", item_size);
157+
//eprintln!("MOVE: {}", item_size);
154158
moved_size += item_size;
155159
new_cgu.items_mut().insert(*item, *rest);
156160
true
@@ -161,7 +165,7 @@ impl<'tcx> Partition<'tcx> for DefaultPartitioning {
161165
new_cgu.increase_size_estimate(moved_size);
162166
old_cgu.decrease_size_estimate(moved_size);
163167

164-
eprintln!("SPLIT2: old:{} -> new:{} new:{}", old_cgu.size_estimate(), new_cgu.size_estimate(), new_cgu.name());
168+
//eprintln!("SPLIT2: old:{} -> new:{} new:{}", old_cgu.size_estimate(), new_cgu.size_estimate(), new_cgu.name());
165169

166170
codegen_units.push(new_cgu);
167171
// njn: explain lack of `i += 1`;

compiler/rustc_monomorphize/src/partitioning/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ fn debug_dump<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx>, label: &str, cgus: &[CodegenUnit<
382382
std::mem::take(s)
383383
};
384384

385-
eprintln!("{}", dump());
385+
debug!("{}", dump());
386386
}
387387

388388
#[inline(never)] // give this a place in the profiler

0 commit comments

Comments
 (0)