aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-link
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-14 23:23:33 +0000
committerChris Lattner <sabre@nondot.org>2001-10-14 23:23:33 +0000
commit164cb69e045f91900410781605cff7e5594460f2 (patch)
tree0da9f19f5c006569ea2d8385b808c3f61f5d6da6 /tools/llvm-link
parent46c6371141c050e1599ba86d9d84447be3b4c786 (diff)
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
Diffstat (limited to 'tools/llvm-link')
-rw-r--r--tools/llvm-link/llvm-link.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp
index 8dbcf4895c..e9e9ac1726 100644
--- a/tools/llvm-link/llvm-link.cpp
+++ b/tools/llvm-link/llvm-link.cpp
@@ -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(),