aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-link
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-15 15:35:07 +0000
committerDan Gohman <gohman@apple.com>2009-09-15 15:35:07 +0000
commita93f30ee65e2fa48c8caff7d5c3052559b0829fb (patch)
tree0580c67f6267a1996c4350ec0dfa50eeb9a0c4e2 /tools/llvm-link
parent04fc8c8d335af7c54d9a4fb8409748d2c84402f3 (diff)
Give llvm-link a -S option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-link')
-rw-r--r--tools/llvm-link/llvm-link.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp
index cb741991bc..fae4d107b1 100644
--- a/tools/llvm-link/llvm-link.cpp
+++ b/tools/llvm-link/llvm-link.cpp
@@ -41,6 +41,10 @@ static cl::opt<bool>
Force("f", cl::desc("Enable binary output on terminals"));
static cl::opt<bool>
+OutputAssembly("S",
+ cl::desc("Write output as LLVM assembly"), cl::Hidden);
+
+static cl::opt<bool>
Verbose("v", cl::desc("Print information about actions taken"));
static cl::opt<bool>
@@ -116,7 +120,7 @@ int main(int argc, char **argv) {
// TODO: Iterate over the -l list and link in any modules containing
// global symbols that have not been resolved so far.
- if (DumpAsm) errs() << "Here's the assembly:\n" << *Composite.get();
+ if (DumpAsm) errs() << "Here's the assembly:\n" << *Composite;
std::string ErrorInfo;
std::auto_ptr<raw_ostream>
@@ -132,13 +136,15 @@ int main(int argc, char **argv) {
if (OutputFilename != "-")
sys::RemoveFileOnSignal(sys::Path(OutputFilename));
- if (verifyModule(*Composite.get())) {
+ if (verifyModule(*Composite)) {
errs() << argv[0] << ": linked module is broken!\n";
return 1;
}
if (Verbose) errs() << "Writing bitcode...\n";
- if (Force || !CheckBitcodeOutputToConsole(*Out, true))
+ if (OutputAssembly) {
+ *Out << *Composite;
+ } else if (Force || !CheckBitcodeOutputToConsole(*Out, true))
WriteBitcodeToFile(Composite.get(), *Out);
return 0;