Skip to content

Commit b2bb8f7

Browse files
committed
Print total node count in -Z hir-stats
1 parent 8adb4b3 commit b2bb8f7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/rustc_passes/src/hir_stats.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ impl<'k> StatCollector<'k> {
126126
});
127127

128128
let total_size = nodes.iter().map(|(_, node)| node.stats.count * node.stats.size).sum();
129+
let total_count = nodes.iter().map(|(_, node)| node.stats.count).sum();
129130

130131
eprintln!("{prefix} {title}");
131132
eprintln!(
@@ -167,7 +168,13 @@ impl<'k> StatCollector<'k> {
167168
}
168169
}
169170
eprintln!("{prefix} ----------------------------------------------------------------");
170-
eprintln!("{} {:<18}{:>10}", prefix, "Total", to_readable_str(total_size));
171+
eprintln!(
172+
"{} {:<18}{:>10} {:>14}",
173+
prefix,
174+
"Total",
175+
to_readable_str(total_size),
176+
to_readable_str(total_count),
177+
);
171178
eprintln!("{prefix}");
172179
}
173180
}

0 commit comments

Comments
 (0)