Add profile code around metadata object generation

cc #719
This commit is contained in:
bjorn3 2019-09-22 16:47:45 +02:00
parent a1bf96f630
commit 1e5cea09d5

View File

@ -215,6 +215,8 @@ fn run_aot(
rustc_incremental::finalize_session_directory(tcx.sess, tcx.crate_hash(LOCAL_CRATE));
let metadata_module = if need_metadata_module {
tcx.sess.profiler(|p| p.start_activity("codegen crate metadata"));
let (metadata_cgu_name, tmp_file) = rustc::util::common::time(tcx.sess, "write compressed metadata", || {
use rustc::mir::mono::CodegenUnitNameBuilder;
let cgu_name_builder = &mut CodegenUnitNameBuilder::new(tcx);
@ -236,6 +238,10 @@ fn run_aot(
let obj = metadata_artifact.emit().unwrap();
std::fs::write(&tmp_file, obj).unwrap();
(metadata_cgu_name, tmp_file)
});
tcx.sess.profiler(|p| p.end_activity("codegen crate metadata"));
Some(CompiledModule {
name: metadata_cgu_name,
kind: ModuleKind::Metadata,