Skip to content

Commit d1df92e

Browse files
committed
Sync from rust d60b29d1ae8147538b8d542f7ffcc03b48e2cbda
2 parents eeb75c7 + 02e1fd4 commit d1df92e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/bin/cg_clif.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern crate rustc_interface;
66
extern crate rustc_session;
77
extern crate rustc_target;
88

9-
use rustc_data_structures::profiling::print_time_passes_entry;
9+
use rustc_data_structures::profiling::{get_resident_set_size, print_time_passes_entry};
1010
use rustc_interface::interface;
1111
use rustc_session::config::ErrorOutputType;
1212
use rustc_session::early_error;
@@ -39,7 +39,8 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
3939
}
4040

4141
fn main() {
42-
let start = std::time::Instant::now();
42+
let start_time = std::time::Instant::now();
43+
let start_rss = get_resident_set_size();
4344
rustc_driver::init_rustc_env_logger();
4445
let mut callbacks = CraneliftPassesCallbacks::default();
4546
rustc_driver::install_ice_hook();
@@ -61,7 +62,11 @@ fn main() {
6162
})));
6263
run_compiler.run()
6364
});
64-
// The extra `\t` is necessary to align this label with the others.
65-
print_time_passes_entry(callbacks.time_passes, "\ttotal", start.elapsed());
65+
66+
if callbacks.time_passes {
67+
let end_rss = get_resident_set_size();
68+
print_time_passes_entry("total", start_time.elapsed(), start_rss, end_rss);
69+
}
70+
6671
std::process::exit(exit_code)
6772
}

0 commit comments

Comments
 (0)