[llvm-commits] [llvm] r131823 - /llvm/trunk/tools/llvm-ld/Optimize.cpp

Chris Lattner sabre at nondot.org
Sat May 21 17:21:15 PDT 2011


Author: lattner
Date: Sat May 21 19:21:15 2011
New Revision: 131823

URL: http://llvm.org/viewvc/llvm-project?rev=131823&view=rev
Log:
switch llvm-ld.  It has a terrible mechanism that people can add extra
passes, it should be converted to use extension points.

Modified:
    llvm/trunk/tools/llvm-ld/Optimize.cpp

Modified: llvm/trunk/tools/llvm-ld/Optimize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ld/Optimize.cpp?rev=131823&r1=131822&r2=131823&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ld/Optimize.cpp (original)
+++ llvm/trunk/tools/llvm-ld/Optimize.cpp Sat May 21 19:21:15 2011
@@ -12,9 +12,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Module.h"
-#include "llvm/PassManager.h"
 #include "llvm/Support/CommandLine.h"
-#include "llvm/Support/StandardPasses.h"
+#include "llvm/Support/PassMAnagerBuilder.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/DynamicLibrary.h"
 #include "llvm/Target/TargetData.h"
@@ -71,11 +70,10 @@
 }
 
 namespace llvm {
-
 /// Optimize - Perform link time optimizations. This will run the scalar
 /// optimizations, any loaded plugin-optimization modules, and then the
 /// inter-procedural optimizations if applicable.
-void Optimize(Module* M) {
+void Optimize(Module *M) {
 
   // Instantiate the pass manager to organize the passes.
   PassManager Passes;
@@ -88,8 +86,8 @@
   addPass(Passes, new TargetData(M));
 
   if (!DisableOptimizations)
-    createStandardLTOPasses(&Passes, !DisableInternalize, !DisableInline,
-                            VerifyEach);
+    PassManagerBuilder().populateLTOPassManager(Passes, !DisableInternalize,
+                                                !DisableInline);
 
   // If the -s or -S command line options were specified, strip the symbols out
   // of the resulting program to make it smaller.  -s and -S are GNU ld options





More information about the llvm-commits mailing list