Skip to content

Commit 12a2941

Browse files
committed
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.
1 parent 69f26b7 commit 12a2941

File tree

1 file changed

+6
-6
lines changed
  • compiler/rustc_codegen_llvm/src

1 file changed

+6
-6
lines changed

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,12 @@ impl CodegenBackend for LlvmCodegenBackend {
282282
rustc_codegen_ssa::back::write::dump_incremental_data(&codegen_results);
283283
}
284284

285+
sess.time("llvm_dump_timing_file", || {
286+
if sess.opts.debugging_opts.llvm_time_trace {
287+
llvm_util::time_trace_profiler_finish("llvm_timings.json");
288+
}
289+
});
290+
285291
Ok((codegen_results, work_products))
286292
}
287293

@@ -307,12 +313,6 @@ impl CodegenBackend for LlvmCodegenBackend {
307313
);
308314
});
309315

310-
sess.time("llvm_dump_timing_file", || {
311-
if sess.opts.debugging_opts.llvm_time_trace {
312-
llvm_util::time_trace_profiler_finish("llvm_timings.json");
313-
}
314-
});
315-
316316
Ok(())
317317
}
318318
}

0 commit comments

Comments
 (0)