aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-ld
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-05-22 00:21:15 +0000
committerChris Lattner <sabre@nondot.org>2011-05-22 00:21:15 +0000
commit9d70b6b306a44d98c5d87f40526666b4ebd107c3 (patch)
tree7d390af08e0f9b0d9f4bffad182ba41e6a35ad19 /tools/llvm-ld
parent817a01ffb24504f5b00fdac9d79aa034c918f28b (diff)
downloadexternal_llvm-9d70b6b306a44d98c5d87f40526666b4ebd107c3.zip
external_llvm-9d70b6b306a44d98c5d87f40526666b4ebd107c3.tar.gz
external_llvm-9d70b6b306a44d98c5d87f40526666b4ebd107c3.tar.bz2
switch llvm-ld. It has a terrible mechanism that people can add extra
passes, it should be converted to use extension points. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ld')
-rw-r--r--tools/llvm-ld/Optimize.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/llvm-ld/Optimize.cpp b/tools/llvm-ld/Optimize.cpp
index ef4502b..d8200e2 100644
--- a/tools/llvm-ld/Optimize.cpp
+++ b/tools/llvm-ld/Optimize.cpp
@@ -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 @@ static inline void addPass(PassManager &PM, Pass *P) {
}
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 @@ void Optimize(Module* M) {
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