about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-04-10 13:46:28 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2021-04-14 18:46:22 +0200
commit56bf873110b9fdcc62534022e9161c515bf0f949 (patch)
tree43f5bde65b1439bda6b44229e44032a09d8cb3bd
parent0319b31f74d901bf578d96515dbe8c98a2b00497 (diff)
downloadrust-56bf873110b9fdcc62534022e9161c515bf0f949.tar.gz
rust-56bf873110b9fdcc62534022e9161c515bf0f949.zip
Time object file writing
-rw-r--r--src/driver/aot.rs22
1 files 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);