]> granicus.if.org Git - clang/commitdiff
adjust to mainline api change.
authorChris Lattner <sabre@nondot.org>
Sat, 21 May 2011 23:50:44 +0000 (23:50 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 21 May 2011 23:50:44 +0000 (23:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131815 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BackendUtil.cpp

index 92b298b7a336db9e6f07656d7a5acf844f7dede1..34c1635daa1c9ae1cb5c04a5480f0343248fbeee 100644 (file)
@@ -110,20 +110,18 @@ void EmitAssemblyHelper::CreatePasses() {
   }
   
   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 @@ void EmitAssemblyHelper::CreatePasses() {
       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;
   }