llvm.org GIT mirror llvm / 8c042c2
opt: Add -S option to print output as LLVM assembly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81082 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 11 years ago
1 changed file(s) with 14 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
6565 cl::desc("Do not write result bitcode file"), cl::Hidden);
6666
6767 static cl::opt
68 OutputAssembly("S",
69 cl::desc("Write output as LLVM assembly"), cl::Hidden);
70
71 static cl::opt
6872 NoVerify("disable-verify", cl::desc("Do not verify result module"), cl::Hidden);
6973
7074 static cl::opt
374378 // If the output is set to be emitted to standard out, and standard out is a
375379 // console, print out a warning message and refuse to do it. We don't
376380 // impress anyone by spewing tons of binary goo to a terminal.
377 if (!Force && !NoOutput && CheckBitcodeOutputToConsole(*Out, !Quiet))
378 NoOutput = true;
381 if (!Force && !NoOutput && !OutputAssembly)
382 if (CheckBitcodeOutputToConsole(*Out, !Quiet))
383 NoOutput = true;
379384
380385 // Create a PassManager to hold and optimize the collection of passes we are
381386 // about to build...
494499 if (!NoVerify && !VerifyEach)
495500 Passes.add(createVerifierPass());
496501
497 // Write bitcode out to disk or outs() as the last step...
498 if (!NoOutput && !AnalyzeOnly)
499 Passes.add(createBitcodeWriterPass(*Out));
502 // Write bitcode or assembly out to disk or outs() as the last step...
503 if (!NoOutput && !AnalyzeOnly) {
504 if (OutputAssembly)
505 Passes.add(createPrintModulePass(Out));
506 else
507 Passes.add(createBitcodeWriterPass(*Out));
508 }
500509
501510 // Now that we have all of the passes ready, run them.
502511 Passes.run(*M.get());