If -fno-builtin is passed, tell TargetLibraryInfo to

turn off all builtin optimizations.

llvm-svn: 125979
This commit is contained in:
Chris Lattner 2011-02-18 22:34:47 +00:00
parent 1341df93f7
commit fa222dfbed
1 changed files with 9 additions and 2 deletions

View File

@ -111,7 +111,11 @@ void EmitAssemblyHelper::CreatePasses() {
FunctionPassManager *FPM = getPerFunctionPasses();
FPM->add(new TargetLibraryInfo(Triple(TheModule->getTargetTriple())));
TargetLibraryInfo *TLI =
new TargetLibraryInfo(Triple(TheModule->getTargetTriple()));
if (!CodeGenOpts.SimplifyLibCalls)
TLI->disableAllFunctions();
FPM->add(TLI);
// In -O0 if checking is disabled, we don't even have per-function passes.
if (CodeGenOpts.VerifyModule)
@ -143,7 +147,10 @@ void EmitAssemblyHelper::CreatePasses() {
PassManager *MPM = getPerModulePasses();
MPM->add(new TargetLibraryInfo(Triple(TheModule->getTargetTriple())));
TLI = new TargetLibraryInfo(Triple(TheModule->getTargetTriple()));
if (!CodeGenOpts.SimplifyLibCalls)
TLI->disableAllFunctions();
MPM->add(TLI);
// For now we always create per module passes.
llvm::createStandardModulePasses(MPM, OptLevel,