From 0b5ca7850bd62a2558a4efb7de0c12dfe1f4fb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Sat, 28 Feb 2015 22:40:39 +0100 Subject: [PATCH] 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. --- src/librustc_trans/back/write.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index a1fc63778ce8a..cd14fe529b1a7 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 {