提交 4988c89e 编写于 作者: J James Miller

Move the initial dead prototype removal pass

上级 a5b87d71
......@@ -10,9 +10,8 @@
use core::prelude::*;
use driver::session::{Session, Session_, No, Less, Default};
use driver::session;
use lib::llvm::{PassRef, ModuleRef,PassManagerRef,ValueRef,TargetDataRef};
use lib::llvm::{PassRef, ModuleRef,PassManagerRef,TargetDataRef};
use lib::llvm::llvm;
use lib;
......@@ -56,12 +55,12 @@ pub fn run(&self, md:ModuleRef) -> bool {
pub fn populatePassManager(pm: &mut PassManager, level:session::OptLevel) {
unsafe {
// We add a lot of potentially-unused prototypes, so strip them right at the
// start. We do it again later when we know for certain which ones are used
pm.addPass(llvm::LLVMCreateStripDeadPrototypesPass());
if level == session::No {
pm.addPass(llvm::LLVMCreateAlwaysInlinerPass());
// We add a lot of unused prototypes, so strip them no matter
// what
pm.addPass(llvm::LLVMCreateStripDeadPrototypesPass());
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册