File tree 2 files changed +13
-16
lines changed
2 files changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ use rustc_session::getopts::{self, Matches};
41
41
use rustc_session:: lint:: { Lint , LintId } ;
42
42
use rustc_session:: output:: collect_crate_types;
43
43
use rustc_session:: { config, filesearch, EarlyDiagCtxt , Session } ;
44
- use rustc_span:: def_id:: LOCAL_CRATE ;
45
44
use rustc_span:: source_map:: FileLoader ;
46
45
use rustc_span:: symbol:: sym;
47
46
use rustc_span:: FileName ;
@@ -448,21 +447,7 @@ fn run_compiler(
448
447
return early_exit( ) ;
449
448
}
450
449
451
- let linker = queries. codegen_and_build_linker( ) ?;
452
-
453
- // This must run after monomorphization so that all generic types
454
- // have been instantiated.
455
- if sess. opts. unstable_opts. print_type_sizes {
456
- sess. code_stats. print_type_sizes( ) ;
457
- }
458
-
459
- if sess. opts. unstable_opts. print_vtable_sizes {
460
- let crate_name = queries. global_ctxt( ) ?. enter( |tcx| tcx. crate_name( LOCAL_CRATE ) ) ;
461
-
462
- sess. code_stats. print_vtable_sizes( crate_name) ;
463
- }
464
-
465
- Ok ( Some ( linker) )
450
+ Ok ( Some ( queries. codegen_and_build_linker( ) ?) )
466
451
} ) ?;
467
452
468
453
// Linking is done outside the `compiler.enter()` so that the
Original file line number Diff line number Diff line change @@ -121,6 +121,18 @@ impl<'tcx> Queries<'tcx> {
121
121
self . global_ctxt ( ) ?. enter ( |tcx| {
122
122
let ongoing_codegen = passes:: start_codegen ( & * self . compiler . codegen_backend , tcx) ?;
123
123
124
+ // This must run after monomorphization so that all generic types
125
+ // have been instantiated.
126
+ if tcx. sess . opts . unstable_opts . print_type_sizes {
127
+ tcx. sess . code_stats . print_type_sizes ( ) ;
128
+ }
129
+
130
+ if tcx. sess . opts . unstable_opts . print_vtable_sizes {
131
+ let crate_name = tcx. crate_name ( LOCAL_CRATE ) ;
132
+
133
+ tcx. sess . code_stats . print_vtable_sizes ( crate_name) ;
134
+ }
135
+
124
136
Ok ( Linker {
125
137
dep_graph : tcx. dep_graph . clone ( ) ,
126
138
output_filenames : tcx. output_filenames ( ( ) ) . clone ( ) ,
You can’t perform that action at this time.
0 commit comments