Rollup merge of #107718 - Zoxc:z-time, r=nnethercote

Add `-Z time-passes-format` to allow specifying a JSON output for `-Z time-passes`

This adds back the `-Z time` option as that is useful for [my rustc benchmark tool](https://github.com/Zoxc/rcb), reverting https://github.com/rust-lang/rust/pull/102725. It now uses nanoseconds and bytes as the units so it is renamed to `time-precise`.
This commit is contained in:
Matthias Krüger 2023-03-23 19:55:43 +01:00 committed by GitHub
commit acd7f878ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 107 additions and 32 deletions

View file

@ -361,12 +361,12 @@ impl CodegenBackend for LlvmCodegenBackend {
.expect("Expected LlvmCodegenBackend's OngoingCodegen, found Box<Any>")
.join(sess);
sess.time("llvm_dump_timing_file", || {
if sess.opts.unstable_opts.llvm_time_trace {
if sess.opts.unstable_opts.llvm_time_trace {
sess.time("llvm_dump_timing_file", || {
let file_name = outputs.with_extension("llvm_timings.json");
llvm_util::time_trace_profiler_finish(&file_name);
}
});
});
}
Ok((codegen_results, work_products))
}