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

Chris Lattner sabre at nondot.org
Sat May 21 16:50:44 PDT 2011


Author: lattner
Date: Sat May 21 18:50:44 2011
New Revision: 131815

URL: http://llvm.org/viewvc/llvm-project?rev=131815&view=rev
Log:
adjust to mainline api change.

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=131815&r1=131814&r2=131815&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Sat May 21 18:50:44 2011
@@ -110,20 +110,18 @@
   }
   
   PassManagerBuilder PMBuilder;
-  PMBuilder.setOptimizationLevel(OptLevel);
-  PMBuilder.setSizeLevel(CodeGenOpts.OptimizeSize);
+  PMBuilder.OptLevel = OptLevel;
+  PMBuilder.SizeLevel = CodeGenOpts.OptimizeSize;
 
-  if (!CodeGenOpts.SimplifyLibCalls) PMBuilder.disableSimplifyLibCalls();
-  if (!CodeGenOpts.UnitAtATime) PMBuilder.disableUnitAtATime();
-  if (!CodeGenOpts.UnrollLoops) PMBuilder.disableUnrollLoops();
+  PMBuilder.DisableSimplifyLibCalls = !CodeGenOpts.SimplifyLibCalls;
+  PMBuilder.DisableUnitAtATime = !CodeGenOpts.UnitAtATime;
+  PMBuilder.DisableUnrollLoops = !CodeGenOpts.UnrollLoops;
   
   // Figure out TargetLibraryInfo.
   Triple TargetTriple(TheModule->getTargetTriple());
-  TargetLibraryInfo *TLI = new TargetLibraryInfo(TargetTriple);
+  PMBuilder.LibraryInfo = new TargetLibraryInfo(TargetTriple);
   if (!CodeGenOpts.SimplifyLibCalls)
-    TLI->disableAllFunctions();
-  PMBuilder.setLibraryInfo(TLI);
-  
+    PMBuilder.LibraryInfo->disableAllFunctions();
   
   switch (Inlining) {
   case CodeGenOptions::NoInlining: break;
@@ -136,12 +134,12 @@
       Threshold = 25;
     else if (OptLevel > 2)
       Threshold = 275;
-    PMBuilder.setInliner(createFunctionInliningPass(Threshold));
+    PMBuilder.Inliner = createFunctionInliningPass(Threshold);
     break;
   }
   case CodeGenOptions::OnlyAlwaysInlining:
     // Respect always_inline.
-    PMBuilder.setInliner(createAlwaysInlinerPass());
+    PMBuilder.Inliner = createAlwaysInlinerPass();
     break;
   }
 





More information about the cfe-commits mailing list