diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-16 15:30:09 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-16 15:30:09 +0000 |
commit | b714fabbab3c2cf4c5312110f0a68d7177e05f7b (patch) | |
tree | a56cfb3fae390064970714d26d13dca84545c1fc /tools/llvm-link | |
parent | 75ffec079e1730e42dc37c9f6fe36f9ef15668dd (diff) | |
download | external_llvm-b714fabbab3c2cf4c5312110f0a68d7177e05f7b.zip external_llvm-b714fabbab3c2cf4c5312110f0a68d7177e05f7b.tar.gz external_llvm-b714fabbab3c2cf4c5312110f0a68d7177e05f7b.tar.bz2 |
Convert more tools code from cerr and cout to errs() and outs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-link')
-rw-r--r-- | tools/llvm-link/llvm-link.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp index b850ffc..a287c47 100644 --- a/tools/llvm-link/llvm-link.cpp +++ b/tools/llvm-link/llvm-link.cpp @@ -21,7 +21,6 @@ #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/PrettyStackTrace.h" -#include "llvm/Support/Streams.h" #include "llvm/System/Signals.h" #include "llvm/System/Path.h" #include <memory> @@ -50,13 +49,13 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN, LLVMContext& Context) { sys::Path Filename; if (!Filename.set(FN)) { - cerr << "Invalid file name: '" << FN << "'\n"; + errs() << "Invalid file name: '" << FN << "'\n"; return std::auto_ptr<Module>(); } std::string ErrorMessage; if (Filename.exists()) { - if (Verbose) cerr << "Loading '" << Filename.c_str() << "'\n"; + if (Verbose) errs() << "Loading '" << Filename.c_str() << "'\n"; Module* Result = 0; const std::string &FNStr = Filename.toString(); @@ -68,12 +67,12 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN, if (Result) return std::auto_ptr<Module>(Result); // Load successful! if (Verbose) { - cerr << "Error opening bitcode file: '" << Filename.c_str() << "'"; - if (ErrorMessage.size()) cerr << ": " << ErrorMessage; - cerr << "\n"; + errs() << "Error opening bitcode file: '" << Filename.c_str() << "'"; + if (ErrorMessage.size()) errs() << ": " << ErrorMessage; + errs() << "\n"; } } else { - cerr << "Bitcode file: '" << Filename.c_str() << "' does not exist.\n"; + errs() << "Bitcode file: '" << Filename.c_str() << "' does not exist.\n"; } return std::auto_ptr<Module>(); @@ -93,23 +92,23 @@ int main(int argc, char **argv) { std::auto_ptr<Module> Composite(LoadFile(InputFilenames[BaseArg], Context)); if (Composite.get() == 0) { - cerr << argv[0] << ": error loading file '" - << InputFilenames[BaseArg] << "'\n"; + errs() << argv[0] << ": error loading file '" + << InputFilenames[BaseArg] << "'\n"; return 1; } for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) { std::auto_ptr<Module> M(LoadFile(InputFilenames[i], Context)); if (M.get() == 0) { - cerr << argv[0] << ": error loading file '" <<InputFilenames[i]<< "'\n"; + errs() << argv[0] << ": error loading file '" <<InputFilenames[i]<< "'\n"; return 1; } - if (Verbose) cerr << "Linking in '" << InputFilenames[i] << "'\n"; + if (Verbose) errs() << "Linking in '" << InputFilenames[i] << "'\n"; if (Linker::LinkModules(Composite.get(), M.get(), &ErrorMessage)) { - cerr << argv[0] << ": link error in '" << InputFilenames[i] - << "': " << ErrorMessage << "\n"; + errs() << argv[0] << ": link error in '" << InputFilenames[i] + << "': " << ErrorMessage << "\n"; return 1; } } @@ -117,7 +116,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) cerr << "Here's the assembly:\n" << *Composite.get(); + if (DumpAsm) errs() << "Here's the assembly:\n" << *Composite.get(); // FIXME: outs() is not binary! raw_ostream *Out = &outs(); // Default to printing to stdout... @@ -139,11 +138,11 @@ int main(int argc, char **argv) { } if (verifyModule(*Composite.get())) { - cerr << argv[0] << ": linked module is broken!\n"; + errs() << argv[0] << ": linked module is broken!\n"; return 1; } - if (Verbose) cerr << "Writing bitcode...\n"; + if (Verbose) errs() << "Writing bitcode...\n"; WriteBitcodeToFile(Composite.get(), *Out); if (Out != &outs()) delete Out; |