about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2015-02-28 22:40:39 +0100
committerBjörn Steinbrink <bsteinbr@gmail.com>2015-02-28 22:40:39 +0100
commit0b5ca7850bd62a2558a4efb7de0c12dfe1f4fb8e (patch)
treeb24c1539a255ddf2f2279925a3f4c1d431cc58f8
parent8a69110c3b1122596ddc8999bb2403a5777bb8ed (diff)
Re-enable -Z time-llvm-passes when using a single codegen unit
The timing code break when using multiple codegen units, but that
shouldn't stop us from using it with a single codegen unit.
-rw-r--r--src/librustc_trans/back/write.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs
index a1fc63778ce..cd14fe529b1 100644
--- a/src/librustc_trans/back/write.rs
+++ b/src/librustc_trans/back/write.rs
@@ -851,7 +851,9 @@ pub fn run_passes(sess: &Session,
 
     // FIXME: time_llvm_passes support - does this use a global context or
     // something?
-    //if sess.time_llvm_passes() { llvm::LLVMRustPrintPassTimings(); }
+    if sess.opts.cg.codegen_units == 1 && sess.time_llvm_passes() {
+        unsafe { llvm::LLVMRustPrintPassTimings(); }
+    }
 }
 
 struct WorkItem {