make asan work at -O0, llvm part. Patch by glider@google.com

llvm-svn: 145530
This commit is contained in:
Kostya Serebryany 2011-11-30 22:19:26 +00:00
parent 2dfb343ffa
commit aa616ec887
2 changed files with 7 additions and 2 deletions

View File

@ -67,7 +67,12 @@ public:
/// EP_ScalarOptimizerLate - This extension point allows adding optimization
/// passes after most of the main optimizations, but before the last
/// cleanup-ish optimizations.
EP_ScalarOptimizerLate
EP_ScalarOptimizerLate,
/// EP_EnabledOnOptLevel0 - This extension point allows adding passes that
/// should not be disabled by O0 optimization level. The passes will be
/// inserted after the inlining pass.
EP_EnabledOnOptLevel0
};
/// The Optimization Level - Specify the basic optimization level.

View File

@ -101,6 +101,7 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
MPM.add(Inliner);
Inliner = 0;
}
addExtensionsToPM(EP_EnabledOnOptLevel0, MPM);
return;
}
@ -340,4 +341,3 @@ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
PassManagerBase *LPM = unwrap(PM);
Builder->populateLTOPassManager(*LPM, Internalize, RunInliner);
}