Add a new -d argument to dump the internal rep as assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@804 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-10-14 23:23:33 +00:00
parent 46c6371141
commit 164cb69e04
2 changed files with 10 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#include "llvm/Transforms/Linker.h"
#include "llvm/Bytecode/Reader.h"
#include "llvm/Bytecode/Writer.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Module.h"
#include "llvm/Method.h"
@ -20,6 +21,7 @@ cl::StringList InputFilenames("", "Load <arg> files, linking them together",
cl::OneOrMore);
cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "-");
cl::Flag Force ("f", "Overwrite output files", cl::NoFlags, false);
cl::Flag DumpAsm ("d", "Print assembly as linked", cl::Hidden, false);
int main(int argc, char **argv) {
@ -47,6 +49,9 @@ int main(int argc, char **argv) {
}
}
if (DumpAsm)
cerr << "Here's the assembly:\n" << Composite.get();
ostream *Out = &cout; // Default to printing to stdout...
if (OutputFilename != "-") {
Out = new ofstream(OutputFilename.c_str(),

View File

@ -9,6 +9,7 @@
#include "llvm/Transforms/Linker.h"
#include "llvm/Bytecode/Reader.h"
#include "llvm/Bytecode/Writer.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Module.h"
#include "llvm/Method.h"
@ -20,6 +21,7 @@ cl::StringList InputFilenames("", "Load <arg> files, linking them together",
cl::OneOrMore);
cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "-");
cl::Flag Force ("f", "Overwrite output files", cl::NoFlags, false);
cl::Flag DumpAsm ("d", "Print assembly as linked", cl::Hidden, false);
int main(int argc, char **argv) {
@ -47,6 +49,9 @@ int main(int argc, char **argv) {
}
}
if (DumpAsm)
cerr << "Here's the assembly:\n" << Composite.get();
ostream *Out = &cout; // Default to printing to stdout...
if (OutputFilename != "-") {
Out = new ofstream(OutputFilename.c_str(),