aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-18 22:34:47 +0000
committerChris Lattner <sabre@nondot.org>2011-02-18 22:34:47 +0000
commit98ec3f78b2f4c17e5aeb5f0c5df4b4ffbfc85565 (patch)
treecba1c4052269a433cb7f22e5485bbe65dc8d6fd8 /lib/CodeGen/BackendUtil.cpp
parent813d8346529bf094eb2b249648906ba7fd226688 (diff)
If -fno-builtin is passed, tell TargetLibraryInfo to
turn off all builtin optimizations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BackendUtil.cpp')
-rw-r--r--lib/CodeGen/BackendUtil.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index 80c3b9cd44..9897b1b1a0 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -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,