diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-12-28 14:12:59 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-28 14:12:59 +0100 |
| commit | 98d80bda01950b16dfa5e4a1fe7ecec0e24614f6 (patch) | |
| tree | cf1dfa900fba4e2fb2231da88d52c82fd55f2418 /compiler/rustc_interface/src | |
| parent | aef92d44e4e83fe7d5ddb741a274754466207402 (diff) | |
| parent | 3a3a23ffc5742885187c84e7db320610c8b352fb (diff) | |
| download | rust-98d80bda01950b16dfa5e4a1fe7ecec0e24614f6.tar.gz rust-98d80bda01950b16dfa5e4a1fe7ecec0e24614f6.zip | |
Rollup merge of #79662 - bjorn3:move_more_code_out_of_codegen_backend, r=oli-obk
Move some more code out of CodegenBackend::{codegen_crate,link}
Kind of a follow up to #77795
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 17 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/queries.rs | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 61ebd6d2198..1a2af48b38d 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -1013,6 +1013,23 @@ pub fn start_codegen<'tcx>( codegen_backend.codegen_crate(tcx, metadata, need_metadata_module) }); + // Don't run these test assertions when not doing codegen. Compiletest tries to build + // build-fail tests in check mode first and expects it to not give an error in that case. + if tcx.sess.opts.output_types.should_codegen() { + rustc_incremental::assert_module_sources::assert_module_sources(tcx); + rustc_symbol_mangling::test::report_symbol_names(tcx); + } + + tcx.sess.time("assert_dep_graph", || rustc_incremental::assert_dep_graph(tcx)); + tcx.sess.time("serialize_dep_graph", || rustc_incremental::save_dep_graph(tcx)); + + // We assume that no queries are run past here. If there are new queries + // after this point, they'll show up as "<unknown>" in self-profiling data. + { + let _prof_timer = tcx.prof.generic_activity("self_profile_alloc_query_strings"); + tcx.alloc_self_profile_query_strings(); + } + info!("Post-codegen\n{:?}", tcx.debug_stats()); if tcx.sess.opts.output_types.contains_key(&OutputType::Mir) { diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index 6ea0828cea0..2384927b301 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -403,6 +403,7 @@ impl Linker { return Ok(()); } + let _timer = sess.prof.verbose_generic_activity("link_crate"); self.codegen_backend.link(&self.sess, codegen_results, &self.prepare_outputs) } } |
