@@ -6,7 +6,7 @@ extern crate rustc_interface;
6
6
extern crate rustc_session;
7
7
extern crate rustc_target;
8
8
9
- use rustc_data_structures:: profiling:: print_time_passes_entry;
9
+ use rustc_data_structures:: profiling:: { get_resident_set_size , print_time_passes_entry} ;
10
10
use rustc_interface:: interface;
11
11
use rustc_session:: config:: ErrorOutputType ;
12
12
use rustc_session:: early_error;
@@ -39,7 +39,8 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
39
39
}
40
40
41
41
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 ( ) ;
43
44
rustc_driver:: init_rustc_env_logger ( ) ;
44
45
let mut callbacks = CraneliftPassesCallbacks :: default ( ) ;
45
46
rustc_driver:: install_ice_hook ( ) ;
@@ -61,7 +62,11 @@ fn main() {
61
62
} ) ) ) ;
62
63
run_compiler. run ( )
63
64
} ) ;
64
- // The extra `\t` is necessary to align this label with the others.
65
- print_time_passes_entry ( callbacks. time_passes , "\t total" , 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
+
66
71
std:: process:: exit ( exit_code)
67
72
}
0 commit comments