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 {