Skip to content

Commit ea6f5cb

Browse files
committed
Move some timers around
1 parent 84873f8 commit ea6f5cb

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

compiler/rustc_codegen_cranelift/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
227227
sess: &Session,
228228
outputs: &OutputFilenames,
229229
) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) {
230-
let _timer = sess.timer("finish_ongoing_codegen");
231-
232230
ongoing_codegen.downcast::<driver::aot::OngoingCodegen>().unwrap().join(sess, outputs)
233231
}
234232
}

compiler/rustc_codegen_ssa/src/back/write.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2028,8 +2028,6 @@ pub struct OngoingCodegen<B: ExtraBackendMethods> {
20282028

20292029
impl<B: ExtraBackendMethods> OngoingCodegen<B> {
20302030
pub fn join(self, sess: &Session) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) {
2031-
let _timer = sess.timer("finish_ongoing_codegen");
2032-
20332031
self.shared_emitter_main.check(sess, true);
20342032
let compiled_modules = sess.time("join_worker_thread", || match self.coordinator.join() {
20352033
Ok(Ok(compiled_modules)) => compiled_modules,

compiler/rustc_driver_impl/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,7 @@ fn run_compiler(
459459
// Linking is done outside the `compiler.enter()` so that the
460460
// `GlobalCtxt` within `Queries` can be freed as early as possible.
461461
if let Some(linker) = linker {
462-
let _timer = sess.timer("link");
463-
linker.link(sess, codegen_backend)?
462+
linker.link(sess, codegen_backend)?;
464463
}
465464

466465
Ok(())

compiler/rustc_interface/src/queries.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,16 @@ impl Linker {
154154
}
155155

156156
pub fn link(self, sess: &Session, codegen_backend: &dyn CodegenBackend) -> Result<()> {
157-
let (codegen_results, work_products) =
158-
codegen_backend.join_codegen(self.ongoing_codegen, sess, &self.output_filenames);
157+
let (codegen_results, work_products) = sess.time("finish_ongoing_codegen", || {
158+
codegen_backend.join_codegen(self.ongoing_codegen, sess, &self.output_filenames)
159+
});
159160

160161
if let Some(guar) = sess.dcx().has_errors() {
161162
return Err(guar);
162163
}
163164

165+
let _timer = sess.timer("link");
166+
164167
sess.time("serialize_work_products", || {
165168
rustc_incremental::save_work_product_index(sess, &self.dep_graph, work_products)
166169
});

0 commit comments

Comments
 (0)