From b714fabbab3c2cf4c5312110f0a68d7177e05f7b Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 16 Jul 2009 15:30:09 +0000 Subject: 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 --- tools/llvm-link/llvm-link.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'tools/llvm-link') 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 @@ -50,13 +49,13 @@ static inline std::auto_ptr 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(); } 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 LoadFile(const std::string &FN, if (Result) return std::auto_ptr(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(); @@ -93,23 +92,23 @@ int main(int argc, char **argv) { std::auto_ptr 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 M(LoadFile(InputFilenames[i], Context)); if (M.get() == 0) { - cerr << argv[0] << ": error loading file '" <