Move llvm_util::time_trace_profiler_finish call to join_codegen

This makes it also run when compilation has failed, neither --emit exe
nor --emit metadata is passed, or -Zno-link is used.
This commit is contained in:
bjorn3 2020-10-10 16:20:42 +02:00
parent 69f26b7761
commit 12a2941214

View File

@ -282,6 +282,12 @@ impl CodegenBackend for LlvmCodegenBackend {
rustc_codegen_ssa::back::write::dump_incremental_data(&codegen_results); rustc_codegen_ssa::back::write::dump_incremental_data(&codegen_results);
} }
sess.time("llvm_dump_timing_file", || {
if sess.opts.debugging_opts.llvm_time_trace {
llvm_util::time_trace_profiler_finish("llvm_timings.json");
}
});
Ok((codegen_results, work_products)) Ok((codegen_results, work_products))
} }
@ -307,12 +313,6 @@ impl CodegenBackend for LlvmCodegenBackend {
); );
}); });
sess.time("llvm_dump_timing_file", || {
if sess.opts.debugging_opts.llvm_time_trace {
llvm_util::time_trace_profiler_finish("llvm_timings.json");
}
});
Ok(()) Ok(())
} }
} }