forked from OSchip/llvm-project
parent
972c9c5e0a
commit
2b09de986c
|
@ -42,6 +42,10 @@ B<llvm-link> will write raw bitcode regardless of the output device.
|
||||||
Specify the output file name. If F<filename> is C<->, then B<llvm-link> will
|
Specify the output file name. If F<filename> is C<->, then B<llvm-link> will
|
||||||
write its output to standard output.
|
write its output to standard output.
|
||||||
|
|
||||||
|
=item B<-S>
|
||||||
|
|
||||||
|
Write output in LLVM intermediate language (instead of bitcode).
|
||||||
|
|
||||||
=item B<-d>
|
=item B<-d>
|
||||||
|
|
||||||
If specified, B<llvm-link> prints a human-readable version of the output
|
If specified, B<llvm-link> prints a human-readable version of the output
|
||||||
|
|
|
@ -40,6 +40,10 @@ OutputFilename("o", cl::desc("Override output filename"), cl::init("-"),
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
Force("f", cl::desc("Enable binary output on terminals"));
|
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>
|
static cl::opt<bool>
|
||||||
Verbose("v", cl::desc("Print information about actions taken"));
|
Verbose("v", cl::desc("Print information about actions taken"));
|
||||||
|
|
||||||
|
@ -116,7 +120,7 @@ int main(int argc, char **argv) {
|
||||||
// TODO: Iterate over the -l list and link in any modules containing
|
// TODO: Iterate over the -l list and link in any modules containing
|
||||||
// global symbols that have not been resolved so far.
|
// 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::string ErrorInfo;
|
||||||
std::auto_ptr<raw_ostream>
|
std::auto_ptr<raw_ostream>
|
||||||
|
@ -132,13 +136,15 @@ int main(int argc, char **argv) {
|
||||||
if (OutputFilename != "-")
|
if (OutputFilename != "-")
|
||||||
sys::RemoveFileOnSignal(sys::Path(OutputFilename));
|
sys::RemoveFileOnSignal(sys::Path(OutputFilename));
|
||||||
|
|
||||||
if (verifyModule(*Composite.get())) {
|
if (verifyModule(*Composite)) {
|
||||||
errs() << argv[0] << ": linked module is broken!\n";
|
errs() << argv[0] << ": linked module is broken!\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Verbose) errs() << "Writing bitcode...\n";
|
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);
|
WriteBitcodeToFile(Composite.get(), *Out);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue