rollup merge of #21191: Zoxc/lto

Fixes #21184
This commit is contained in:
Alex Crichton 2015-01-15 14:12:04 -08:00
commit 09c0342116

View File

@ -167,7 +167,10 @@ pub fn run(sess: &session::Session, llmod: ModuleRef,
llvm::LLVMRustAddAnalysisPasses(tm, pm, llmod);
llvm::LLVMRustAddPass(pm, "verify\0".as_ptr() as *const _);
let opt = sess.opts.cg.opt_level.unwrap_or(0) as libc::c_uint;
let builder = llvm::LLVMPassManagerBuilderCreate();
llvm::LLVMPassManagerBuilderSetOptLevel(builder, opt);
llvm::LLVMPassManagerBuilderPopulateLTOPassManager(builder, pm,
/* Internalize = */ False,
/* RunInliner = */ True);