From 56bf873110b9fdcc62534022e9161c515bf0f949 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 10 Apr 2021 13:46:28 +0200 Subject: [PATCH] Time object file writing --- src/driver/aot.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/driver/aot.rs b/src/driver/aot.rs index 3ff96d710e5..9c5cd53d866 100644 --- a/src/driver/aot.rs +++ b/src/driver/aot.rs @@ -136,15 +136,19 @@ fn module_codegen( } crate::main_shim::maybe_create_entry_wrapper(tcx, &mut module, &mut cx.unwind_context, false); - let codegen_result = emit_module( - tcx, - &backend_config, - cgu.name().as_str().to_string(), - ModuleKind::Regular, - module, - cx.debug_context, - cx.unwind_context, - ); + let debug_context = cx.debug_context; + let unwind_context = cx.unwind_context; + let codegen_result = tcx.sess.time("write object file", || { + emit_module( + tcx, + &backend_config, + cgu.name().as_str().to_string(), + ModuleKind::Regular, + module, + debug_context, + unwind_context, + ) + }); codegen_global_asm(tcx, &cgu.name().as_str(), &cx.global_asm); -- 2.44.0