llvm.org GIT mirror llvm / 817a01f
switch bugpoint and liblto to PassManagerBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131821 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 8 years ago
2 changed file(s) with 16 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
2121 #include "llvm/Support/ManagedStatic.h"
2222 #include "llvm/Support/PluginLoader.h"
2323 #include "llvm/Support/PrettyStackTrace.h"
24 #include "llvm/Support/StandardPasses.h"
24 #include "llvm/Support/PassManagerBuilder.h"
2525 #include "llvm/Support/Process.h"
2626 #include "llvm/Support/Signals.h"
2727 #include "llvm/Support/Valgrind.h"
145145
146146 AddToDriver PM(D);
147147 if (StandardCompileOpts) {
148 createStandardModulePasses(&PM, 3,
149 /*OptimizeSize=*/ false,
150 /*UnitAtATime=*/ true,
151 /*UnrollLoops=*/ true,
152 /*SimplifyLibCalls=*/ true,
153 /*HaveExceptions=*/ true,
154 createFunctionInliningPass());
148 PassManagerBuilder Builder;
149 Builder.OptLevel = 3;
150 Builder.Inliner = createFunctionInliningPass();
151 Builder.populateModulePassManager(PM);
155152 }
156153
157 if (StandardLinkOpts)
158 createStandardLTOPasses(&PM, /*Internalize=*/true,
159 /*RunInliner=*/true,
160 /*VerifyEach=*/false);
154 if (StandardLinkOpts) {
155 PassManagerBuilder Builder;
156 Builder.populateLTOPassManager(PM, /*Internalize=*/true,
157 /*RunInliner=*/true);
158 }
161159
162160
163161 for (std::vector::iterator I = PassList.begin(),
1313
1414 #include "LTOModule.h"
1515 #include "LTOCodeGenerator.h"
16
1716 #include "llvm/Constants.h"
1817 #include "llvm/DerivedTypes.h"
1918 #include "llvm/Linker.h"
3635 #include "llvm/Support/CommandLine.h"
3736 #include "llvm/Support/FormattedStream.h"
3837 #include "llvm/Support/MemoryBuffer.h"
39 #include "llvm/Support/StandardPasses.h"
38 #include "llvm/Support/PassManagerBuilder.h"
4039 #include "llvm/Support/SystemUtils.h"
4140 #include "llvm/Support/ToolOutputFile.h"
4241 #include "llvm/Support/Host.h"
354353 }
355354
356355 /// Optimize merged modules using various IPO passes
357 bool LTOCodeGenerator::generateObjectFile(raw_ostream& out,
358 std::string& errMsg)
359 {
356 bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
357 std::string &errMsg) {
360358 if ( this->determineTarget(errMsg) )
361359 return true;
362360
379377 // Add an appropriate TargetData instance for this module...
380378 passes.add(new TargetData(*_target->getTargetData()));
381379
382 createStandardLTOPasses(&passes, /*Internalize=*/ false, !DisableInline,
383 /*VerifyEach=*/ false);
380 PassManagerBuilder().populateLTOPassManager(passes, /*Internalize=*/ false,
381 !DisableInline);
384382
385383 // Make sure everything is still good.
386384 passes.add(createVerifierPass());
387385
388 FunctionPassManager* codeGenPasses = new FunctionPassManager(mergedModule);
386 FunctionPassManager *codeGenPasses = new FunctionPassManager(mergedModule);
389387
390388 codeGenPasses->add(new TargetData(*_target->getTargetData()));
391389