Another try at fixing cmake.
[llvm/stm8.git] / tools / opt / opt.cpp
blob25474c44a6ef0bbc754056b939c14b86db5fc827
1 //===- opt.cpp - The LLVM Modular Optimizer -------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Optimizations may be specified an arbitrary number of times on the command
11 // line, They are run in the order specified.
13 //===----------------------------------------------------------------------===//
15 #include "llvm/LLVMContext.h"
16 #include "llvm/Module.h"
17 #include "llvm/PassManager.h"
18 #include "llvm/CallGraphSCCPass.h"
19 #include "llvm/Bitcode/ReaderWriter.h"
20 #include "llvm/Assembly/PrintModulePass.h"
21 #include "llvm/Analysis/DebugInfo.h"
22 #include "llvm/Analysis/Verifier.h"
23 #include "llvm/Analysis/LoopPass.h"
24 #include "llvm/Analysis/RegionPass.h"
25 #include "llvm/Analysis/CallGraph.h"
26 #include "llvm/Target/TargetData.h"
27 #include "llvm/Target/TargetLibraryInfo.h"
28 #include "llvm/Target/TargetMachine.h"
29 #include "llvm/ADT/StringSet.h"
30 #include "llvm/ADT/Triple.h"
31 #include "llvm/Support/PassNameParser.h"
32 #include "llvm/Support/Signals.h"
33 #include "llvm/Support/Debug.h"
34 #include "llvm/Support/IRReader.h"
35 #include "llvm/Support/ManagedStatic.h"
36 #include "llvm/Support/PluginLoader.h"
37 #include "llvm/Support/PrettyStackTrace.h"
38 #include "llvm/Support/StandardPasses.h"
39 #include "llvm/Support/SystemUtils.h"
40 #include "llvm/Support/ToolOutputFile.h"
41 #include "llvm/LinkAllPasses.h"
42 #include "llvm/LinkAllVMCore.h"
43 #include <memory>
44 #include <algorithm>
45 using namespace llvm;
47 // The OptimizationList is automatically populated with registered Passes by the
48 // PassNameParser.
50 static cl::list<const PassInfo*, bool, PassNameParser>
51 PassList(cl::desc("Optimizations available:"));
53 // Other command line options...
55 static cl::opt<std::string>
56 InputFilename(cl::Positional, cl::desc("<input bitcode file>"),
57 cl::init("-"), cl::value_desc("filename"));
59 static cl::opt<std::string>
60 OutputFilename("o", cl::desc("Override output filename"),
61 cl::value_desc("filename"));
63 static cl::opt<bool>
64 Force("f", cl::desc("Enable binary output on terminals"));
66 static cl::opt<bool>
67 PrintEachXForm("p", cl::desc("Print module after each transformation"));
69 static cl::opt<bool>
70 NoOutput("disable-output",
71 cl::desc("Do not write result bitcode file"), cl::Hidden);
73 static cl::opt<bool>
74 OutputAssembly("S", cl::desc("Write output as LLVM assembly"));
76 static cl::opt<bool>
77 NoVerify("disable-verify", cl::desc("Do not verify result module"), cl::Hidden);
79 static cl::opt<bool>
80 VerifyEach("verify-each", cl::desc("Verify after each transform"));
82 static cl::opt<bool>
83 StripDebug("strip-debug",
84 cl::desc("Strip debugger symbol info from translation unit"));
86 static cl::opt<bool>
87 DisableInline("disable-inlining", cl::desc("Do not run the inliner pass"));
89 static cl::opt<bool>
90 DisableOptimizations("disable-opt",
91 cl::desc("Do not run any optimization passes"));
93 static cl::opt<bool>
94 DisableInternalize("disable-internalize",
95 cl::desc("Do not mark all symbols as internal"));
97 static cl::opt<bool>
98 StandardCompileOpts("std-compile-opts",
99 cl::desc("Include the standard compile time optimizations"));
101 static cl::opt<bool>
102 StandardLinkOpts("std-link-opts",
103 cl::desc("Include the standard link time optimizations"));
105 static cl::opt<bool>
106 OptLevelO1("O1",
107 cl::desc("Optimization level 1. Similar to llvm-gcc -O1"));
109 static cl::opt<bool>
110 OptLevelO2("O2",
111 cl::desc("Optimization level 2. Similar to llvm-gcc -O2"));
113 static cl::opt<bool>
114 OptLevelO3("O3",
115 cl::desc("Optimization level 3. Similar to llvm-gcc -O3"));
117 static cl::opt<bool>
118 UnitAtATime("funit-at-a-time",
119 cl::desc("Enable IPO. This is same as llvm-gcc's -funit-at-a-time"),
120 cl::init(true));
122 static cl::opt<bool>
123 DisableSimplifyLibCalls("disable-simplify-libcalls",
124 cl::desc("Disable simplify-libcalls"));
126 static cl::opt<bool>
127 Quiet("q", cl::desc("Obsolete option"), cl::Hidden);
129 static cl::alias
130 QuietA("quiet", cl::desc("Alias for -q"), cl::aliasopt(Quiet));
132 static cl::opt<bool>
133 AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization"));
135 static cl::opt<bool>
136 PrintBreakpoints("print-breakpoints-for-testing",
137 cl::desc("Print select breakpoints location for testing"));
139 static cl::opt<std::string>
140 DefaultDataLayout("default-data-layout",
141 cl::desc("data layout string to use if not specified by module"),
142 cl::value_desc("layout-string"), cl::init(""));
144 // ---------- Define Printers for module and function passes ------------
145 namespace {
147 struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
148 static char ID;
149 const PassInfo *PassToPrint;
150 raw_ostream &Out;
151 std::string PassName;
153 CallGraphSCCPassPrinter(const PassInfo *PI, raw_ostream &out) :
154 CallGraphSCCPass(ID), PassToPrint(PI), Out(out) {
155 std::string PassToPrintName = PassToPrint->getPassName();
156 PassName = "CallGraphSCCPass Printer: " + PassToPrintName;
159 virtual bool runOnSCC(CallGraphSCC &SCC) {
160 if (!Quiet)
161 Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
163 // Get and print pass...
164 for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
165 Function *F = (*I)->getFunction();
166 if (F)
167 getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
168 F->getParent());
170 return false;
173 virtual const char *getPassName() const { return PassName.c_str(); }
175 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
176 AU.addRequiredID(PassToPrint->getTypeInfo());
177 AU.setPreservesAll();
181 char CallGraphSCCPassPrinter::ID = 0;
183 struct ModulePassPrinter : public ModulePass {
184 static char ID;
185 const PassInfo *PassToPrint;
186 raw_ostream &Out;
187 std::string PassName;
189 ModulePassPrinter(const PassInfo *PI, raw_ostream &out)
190 : ModulePass(ID), PassToPrint(PI), Out(out) {
191 std::string PassToPrintName = PassToPrint->getPassName();
192 PassName = "ModulePass Printer: " + PassToPrintName;
195 virtual bool runOnModule(Module &M) {
196 if (!Quiet)
197 Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
199 // Get and print pass...
200 getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out, &M);
201 return false;
204 virtual const char *getPassName() const { return PassName.c_str(); }
206 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
207 AU.addRequiredID(PassToPrint->getTypeInfo());
208 AU.setPreservesAll();
212 char ModulePassPrinter::ID = 0;
213 struct FunctionPassPrinter : public FunctionPass {
214 const PassInfo *PassToPrint;
215 raw_ostream &Out;
216 static char ID;
217 std::string PassName;
219 FunctionPassPrinter(const PassInfo *PI, raw_ostream &out)
220 : FunctionPass(ID), PassToPrint(PI), Out(out) {
221 std::string PassToPrintName = PassToPrint->getPassName();
222 PassName = "FunctionPass Printer: " + PassToPrintName;
225 virtual bool runOnFunction(Function &F) {
226 if (!Quiet)
227 Out << "Printing analysis '" << PassToPrint->getPassName()
228 << "' for function '" << F.getName() << "':\n";
230 // Get and print pass...
231 getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
232 F.getParent());
233 return false;
236 virtual const char *getPassName() const { return PassName.c_str(); }
238 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
239 AU.addRequiredID(PassToPrint->getTypeInfo());
240 AU.setPreservesAll();
244 char FunctionPassPrinter::ID = 0;
246 struct LoopPassPrinter : public LoopPass {
247 static char ID;
248 const PassInfo *PassToPrint;
249 raw_ostream &Out;
250 std::string PassName;
252 LoopPassPrinter(const PassInfo *PI, raw_ostream &out) :
253 LoopPass(ID), PassToPrint(PI), Out(out) {
254 std::string PassToPrintName = PassToPrint->getPassName();
255 PassName = "LoopPass Printer: " + PassToPrintName;
259 virtual bool runOnLoop(Loop *L, LPPassManager &LPM) {
260 if (!Quiet)
261 Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
263 // Get and print pass...
264 getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
265 L->getHeader()->getParent()->getParent());
266 return false;
269 virtual const char *getPassName() const { return PassName.c_str(); }
271 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
272 AU.addRequiredID(PassToPrint->getTypeInfo());
273 AU.setPreservesAll();
277 char LoopPassPrinter::ID = 0;
279 struct RegionPassPrinter : public RegionPass {
280 static char ID;
281 const PassInfo *PassToPrint;
282 raw_ostream &Out;
283 std::string PassName;
285 RegionPassPrinter(const PassInfo *PI, raw_ostream &out) : RegionPass(ID),
286 PassToPrint(PI), Out(out) {
287 std::string PassToPrintName = PassToPrint->getPassName();
288 PassName = "RegionPass Printer: " + PassToPrintName;
291 virtual bool runOnRegion(Region *R, RGPassManager &RGM) {
292 if (!Quiet) {
293 Out << "Printing analysis '" << PassToPrint->getPassName() << "' for "
294 << "region: '" << R->getNameStr() << "' in function '"
295 << R->getEntry()->getParent()->getNameStr() << "':\n";
297 // Get and print pass...
298 getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
299 R->getEntry()->getParent()->getParent());
300 return false;
303 virtual const char *getPassName() const { return PassName.c_str(); }
305 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
306 AU.addRequiredID(PassToPrint->getTypeInfo());
307 AU.setPreservesAll();
311 char RegionPassPrinter::ID = 0;
313 struct BasicBlockPassPrinter : public BasicBlockPass {
314 const PassInfo *PassToPrint;
315 raw_ostream &Out;
316 static char ID;
317 std::string PassName;
319 BasicBlockPassPrinter(const PassInfo *PI, raw_ostream &out)
320 : BasicBlockPass(ID), PassToPrint(PI), Out(out) {
321 std::string PassToPrintName = PassToPrint->getPassName();
322 PassName = "BasicBlockPass Printer: " + PassToPrintName;
325 virtual bool runOnBasicBlock(BasicBlock &BB) {
326 if (!Quiet)
327 Out << "Printing Analysis info for BasicBlock '" << BB.getName()
328 << "': Pass " << PassToPrint->getPassName() << ":\n";
330 // Get and print pass...
331 getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
332 BB.getParent()->getParent());
333 return false;
336 virtual const char *getPassName() const { return PassName.c_str(); }
338 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
339 AU.addRequiredID(PassToPrint->getTypeInfo());
340 AU.setPreservesAll();
344 char BasicBlockPassPrinter::ID = 0;
346 struct BreakpointPrinter : public ModulePass {
347 raw_ostream &Out;
348 static char ID;
350 BreakpointPrinter(raw_ostream &out)
351 : ModulePass(ID), Out(out) {
354 void getContextName(DIDescriptor Context, std::string &N) {
355 if (Context.isNameSpace()) {
356 DINameSpace NS(Context);
357 if (!NS.getName().empty()) {
358 getContextName(NS.getContext(), N);
359 N = N + NS.getName().str() + "::";
361 } else if (Context.isType()) {
362 DIType TY(Context);
363 if (!TY.getName().empty()) {
364 getContextName(TY.getContext(), N);
365 N = N + TY.getName().str() + "::";
370 virtual bool runOnModule(Module &M) {
371 StringSet<> Processed;
372 if (NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.sp"))
373 for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
374 std::string Name;
375 DISubprogram SP(NMD->getOperand(i));
376 if (SP.Verify())
377 getContextName(SP.getContext(), Name);
378 Name = Name + SP.getDisplayName().str();
379 if (!Name.empty() && Processed.insert(Name)) {
380 Out << Name << "\n";
383 return false;
386 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
387 AU.setPreservesAll();
391 char BreakpointPrinter::ID = 0;
393 inline void addPass(PassManagerBase &PM, Pass *P) {
394 // Add the pass to the pass manager...
395 PM.add(P);
397 // If we are verifying all of the intermediate steps, add the verifier...
398 if (VerifyEach) PM.add(createVerifierPass());
401 /// AddOptimizationPasses - This routine adds optimization passes
402 /// based on selected optimization level, OptLevel. This routine
403 /// duplicates llvm-gcc behaviour.
405 /// OptLevel - Optimization Level
406 void AddOptimizationPasses(PassManagerBase &MPM, PassManagerBase &FPM,
407 unsigned OptLevel) {
408 createStandardFunctionPasses(&FPM, OptLevel);
410 llvm::Pass *InliningPass = 0;
411 if (DisableInline) {
412 // No inlining pass
413 } else if (OptLevel) {
414 unsigned Threshold = 225;
415 if (OptLevel > 2)
416 Threshold = 275;
417 InliningPass = createFunctionInliningPass(Threshold);
418 } else {
419 InliningPass = createAlwaysInlinerPass();
421 createStandardModulePasses(&MPM, OptLevel,
422 /*OptimizeSize=*/ false,
423 UnitAtATime,
424 /*UnrollLoops=*/ OptLevel > 1,
425 !DisableSimplifyLibCalls,
426 /*HaveExceptions=*/ true,
427 InliningPass);
430 void AddStandardCompilePasses(PassManagerBase &PM) {
431 PM.add(createVerifierPass()); // Verify that input is correct
433 addPass(PM, createLowerSetJmpPass()); // Lower llvm.setjmp/.longjmp
435 // If the -strip-debug command line option was specified, do it.
436 if (StripDebug)
437 addPass(PM, createStripSymbolsPass(true));
439 if (DisableOptimizations) return;
441 llvm::Pass *InliningPass = !DisableInline ? createFunctionInliningPass() : 0;
443 // -std-compile-opts adds the same module passes as -O3.
444 createStandardModulePasses(&PM, 3,
445 /*OptimizeSize=*/ false,
446 /*UnitAtATime=*/ true,
447 /*UnrollLoops=*/ true,
448 !DisableSimplifyLibCalls,
449 /*HaveExceptions=*/ true,
450 InliningPass);
453 void AddStandardLinkPasses(PassManagerBase &PM) {
454 PM.add(createVerifierPass()); // Verify that input is correct
456 // If the -strip-debug command line option was specified, do it.
457 if (StripDebug)
458 addPass(PM, createStripSymbolsPass(true));
460 if (DisableOptimizations) return;
462 createStandardLTOPasses(&PM, /*Internalize=*/ !DisableInternalize,
463 /*RunInliner=*/ !DisableInline,
464 /*VerifyEach=*/ VerifyEach);
467 } // anonymous namespace
470 //===----------------------------------------------------------------------===//
471 // main for opt
473 int main(int argc, char **argv) {
474 sys::PrintStackTraceOnErrorSignal();
475 llvm::PrettyStackTraceProgram X(argc, argv);
477 // Enable debug stream buffering.
478 EnableDebugBuffering = true;
480 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
481 LLVMContext &Context = getGlobalContext();
483 // Initialize passes
484 PassRegistry &Registry = *PassRegistry::getPassRegistry();
485 initializeCore(Registry);
486 initializeScalarOpts(Registry);
487 initializeIPO(Registry);
488 initializeAnalysis(Registry);
489 initializeIPA(Registry);
490 initializeTransformUtils(Registry);
491 initializeInstCombine(Registry);
492 initializeInstrumentation(Registry);
493 initializeTarget(Registry);
495 cl::ParseCommandLineOptions(argc, argv,
496 "llvm .bc -> .bc modular optimizer and analysis printer\n");
498 if (AnalyzeOnly && NoOutput) {
499 errs() << argv[0] << ": analyze mode conflicts with no-output mode.\n";
500 return 1;
503 // Allocate a full target machine description only if necessary.
504 // FIXME: The choice of target should be controllable on the command line.
505 std::auto_ptr<TargetMachine> target;
507 SMDiagnostic Err;
509 // Load the input module...
510 std::auto_ptr<Module> M;
511 M.reset(ParseIRFile(InputFilename, Err, Context));
513 if (M.get() == 0) {
514 Err.Print(argv[0], errs());
515 return 1;
518 // Figure out what stream we are supposed to write to...
519 OwningPtr<tool_output_file> Out;
520 if (NoOutput) {
521 if (!OutputFilename.empty())
522 errs() << "WARNING: The -o (output filename) option is ignored when\n"
523 "the --disable-output option is used.\n";
524 } else {
525 // Default to standard output.
526 if (OutputFilename.empty())
527 OutputFilename = "-";
529 std::string ErrorInfo;
530 Out.reset(new tool_output_file(OutputFilename.c_str(), ErrorInfo,
531 raw_fd_ostream::F_Binary));
532 if (!ErrorInfo.empty()) {
533 errs() << ErrorInfo << '\n';
534 return 1;
538 // If the output is set to be emitted to standard out, and standard out is a
539 // console, print out a warning message and refuse to do it. We don't
540 // impress anyone by spewing tons of binary goo to a terminal.
541 if (!Force && !NoOutput && !AnalyzeOnly && !OutputAssembly)
542 if (CheckBitcodeOutputToConsole(Out->os(), !Quiet))
543 NoOutput = true;
545 // Create a PassManager to hold and optimize the collection of passes we are
546 // about to build.
548 PassManager Passes;
550 // Add an appropriate TargetLibraryInfo pass for the module's triple.
551 TargetLibraryInfo *TLI = new TargetLibraryInfo(Triple(M->getTargetTriple()));
553 // The -disable-simplify-libcalls flag actually disables all builtin optzns.
554 if (DisableSimplifyLibCalls)
555 TLI->disableAllFunctions();
556 Passes.add(TLI);
558 // Add an appropriate TargetData instance for this module.
559 TargetData *TD = 0;
560 const std::string &ModuleDataLayout = M.get()->getDataLayout();
561 if (!ModuleDataLayout.empty())
562 TD = new TargetData(ModuleDataLayout);
563 else if (!DefaultDataLayout.empty())
564 TD = new TargetData(DefaultDataLayout);
566 if (TD)
567 Passes.add(TD);
569 OwningPtr<PassManager> FPasses;
570 if (OptLevelO1 || OptLevelO2 || OptLevelO3) {
571 FPasses.reset(new PassManager());
572 if (TD)
573 FPasses->add(new TargetData(*TD));
576 if (PrintBreakpoints) {
577 // Default to standard output.
578 if (!Out) {
579 if (OutputFilename.empty())
580 OutputFilename = "-";
582 std::string ErrorInfo;
583 Out.reset(new tool_output_file(OutputFilename.c_str(), ErrorInfo,
584 raw_fd_ostream::F_Binary));
585 if (!ErrorInfo.empty()) {
586 errs() << ErrorInfo << '\n';
587 return 1;
590 Passes.add(new BreakpointPrinter(Out->os()));
591 NoOutput = true;
594 // If the -strip-debug command line option was specified, add it. If
595 // -std-compile-opts was also specified, it will handle StripDebug.
596 if (StripDebug && !StandardCompileOpts)
597 addPass(Passes, createStripSymbolsPass(true));
599 // Create a new optimization pass for each one specified on the command line
600 for (unsigned i = 0; i < PassList.size(); ++i) {
601 // Check to see if -std-compile-opts was specified before this option. If
602 // so, handle it.
603 if (StandardCompileOpts &&
604 StandardCompileOpts.getPosition() < PassList.getPosition(i)) {
605 AddStandardCompilePasses(Passes);
606 StandardCompileOpts = false;
609 if (StandardLinkOpts &&
610 StandardLinkOpts.getPosition() < PassList.getPosition(i)) {
611 AddStandardLinkPasses(Passes);
612 StandardLinkOpts = false;
615 if (OptLevelO1 && OptLevelO1.getPosition() < PassList.getPosition(i)) {
616 AddOptimizationPasses(Passes, *FPasses, 1);
617 OptLevelO1 = false;
620 if (OptLevelO2 && OptLevelO2.getPosition() < PassList.getPosition(i)) {
621 AddOptimizationPasses(Passes, *FPasses, 2);
622 OptLevelO2 = false;
625 if (OptLevelO3 && OptLevelO3.getPosition() < PassList.getPosition(i)) {
626 AddOptimizationPasses(Passes, *FPasses, 3);
627 OptLevelO3 = false;
630 const PassInfo *PassInf = PassList[i];
631 Pass *P = 0;
632 if (PassInf->getNormalCtor())
633 P = PassInf->getNormalCtor()();
634 else
635 errs() << argv[0] << ": cannot create pass: "
636 << PassInf->getPassName() << "\n";
637 if (P) {
638 PassKind Kind = P->getPassKind();
639 addPass(Passes, P);
641 if (AnalyzeOnly) {
642 switch (Kind) {
643 case PT_BasicBlock:
644 Passes.add(new BasicBlockPassPrinter(PassInf, Out->os()));
645 break;
646 case PT_Region:
647 Passes.add(new RegionPassPrinter(PassInf, Out->os()));
648 break;
649 case PT_Loop:
650 Passes.add(new LoopPassPrinter(PassInf, Out->os()));
651 break;
652 case PT_Function:
653 Passes.add(new FunctionPassPrinter(PassInf, Out->os()));
654 break;
655 case PT_CallGraphSCC:
656 Passes.add(new CallGraphSCCPassPrinter(PassInf, Out->os()));
657 break;
658 default:
659 Passes.add(new ModulePassPrinter(PassInf, Out->os()));
660 break;
665 if (PrintEachXForm)
666 Passes.add(createPrintModulePass(&errs()));
669 // If -std-compile-opts was specified at the end of the pass list, add them.
670 if (StandardCompileOpts) {
671 AddStandardCompilePasses(Passes);
672 StandardCompileOpts = false;
675 if (StandardLinkOpts) {
676 AddStandardLinkPasses(Passes);
677 StandardLinkOpts = false;
680 if (OptLevelO1)
681 AddOptimizationPasses(Passes, *FPasses, 1);
683 if (OptLevelO2)
684 AddOptimizationPasses(Passes, *FPasses, 2);
686 if (OptLevelO3)
687 AddOptimizationPasses(Passes, *FPasses, 3);
689 if (OptLevelO1 || OptLevelO2 || OptLevelO3)
690 FPasses->run(*M.get());
692 // Check that the module is well formed on completion of optimization
693 if (!NoVerify && !VerifyEach)
694 Passes.add(createVerifierPass());
696 // Write bitcode or assembly to the output as the last step...
697 if (!NoOutput && !AnalyzeOnly) {
698 if (OutputAssembly)
699 Passes.add(createPrintModulePass(&Out->os()));
700 else
701 Passes.add(createBitcodeWriterPass(Out->os()));
704 // Before executing passes, print the final values of the LLVM options.
705 cl::PrintOptionValues();
707 // Now that we have all of the passes ready, run them.
708 Passes.run(*M.get());
710 // Declare success.
711 if (!NoOutput || PrintBreakpoints)
712 Out->keep();
714 return 0;