[cfe-commits] r125979 - /cfe/trunk/lib/CodeGen/BackendUtil.cpp

Chris Lattner sabre at nondot.org
Fri Feb 18 14:34:48 PST 2011


Author: lattner
Date: Fri Feb 18 16:34:47 2011
New Revision: 125979

URL: http://llvm.org/viewvc/llvm-project?rev=125979&view=rev
Log:
If -fno-builtin is passed, tell TargetLibraryInfo to
turn off all builtin optimizations.

Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=125979&r1=125978&r2=125979&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Fri Feb 18 16:34:47 2011
@@ -111,7 +111,11 @@
   
   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 @@
 
   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,





More information about the cfe-commits mailing list