mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 02:33:33 +00:00
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
This commit is contained in:
parent
31dc49d5ab
commit
8c042c2337
@ -65,6 +65,10 @@ static cl::opt<bool>
|
|||||||
NoOutput("disable-output",
|
NoOutput("disable-output",
|
||||||
cl::desc("Do not write result bitcode file"), cl::Hidden);
|
cl::desc("Do not write result bitcode file"), cl::Hidden);
|
||||||
|
|
||||||
|
static cl::opt<bool>
|
||||||
|
OutputAssembly("S",
|
||||||
|
cl::desc("Write output as LLVM assembly"), cl::Hidden);
|
||||||
|
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
NoVerify("disable-verify", cl::desc("Do not verify result module"), cl::Hidden);
|
NoVerify("disable-verify", cl::desc("Do not verify result module"), cl::Hidden);
|
||||||
|
|
||||||
@ -375,8 +379,9 @@ int main(int argc, char **argv) {
|
|||||||
// If the output is set to be emitted to standard out, and standard out is a
|
// If the output is set to be emitted to standard out, and standard out is a
|
||||||
// console, print out a warning message and refuse to do it. We don't
|
// console, print out a warning message and refuse to do it. We don't
|
||||||
// impress anyone by spewing tons of binary goo to a terminal.
|
// impress anyone by spewing tons of binary goo to a terminal.
|
||||||
if (!Force && !NoOutput && CheckBitcodeOutputToConsole(*Out, !Quiet))
|
if (!Force && !NoOutput && !OutputAssembly)
|
||||||
NoOutput = true;
|
if (CheckBitcodeOutputToConsole(*Out, !Quiet))
|
||||||
|
NoOutput = true;
|
||||||
|
|
||||||
// Create a PassManager to hold and optimize the collection of passes we are
|
// Create a PassManager to hold and optimize the collection of passes we are
|
||||||
// about to build...
|
// about to build...
|
||||||
@ -495,9 +500,13 @@ int main(int argc, char **argv) {
|
|||||||
if (!NoVerify && !VerifyEach)
|
if (!NoVerify && !VerifyEach)
|
||||||
Passes.add(createVerifierPass());
|
Passes.add(createVerifierPass());
|
||||||
|
|
||||||
// Write bitcode out to disk or outs() as the last step...
|
// Write bitcode or assembly out to disk or outs() as the last step...
|
||||||
if (!NoOutput && !AnalyzeOnly)
|
if (!NoOutput && !AnalyzeOnly) {
|
||||||
Passes.add(createBitcodeWriterPass(*Out));
|
if (OutputAssembly)
|
||||||
|
Passes.add(createPrintModulePass(Out));
|
||||||
|
else
|
||||||
|
Passes.add(createBitcodeWriterPass(*Out));
|
||||||
|
}
|
||||||
|
|
||||||
// Now that we have all of the passes ready, run them.
|
// Now that we have all of the passes ready, run them.
|
||||||
Passes.run(*M.get());
|
Passes.run(*M.get());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user