diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-15 16:35:29 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-15 16:35:29 +0000 |
commit | f8b81bfe608d09be3cbe7d58718052cd6fa4355c (patch) | |
tree | af96a9f73e7b0060483af26b6f3e1a6210677b67 /tools/llvm-ar | |
parent | 843796c2bc241b502735a62b8590d07ff74b8415 (diff) | |
download | external_llvm-f8b81bfe608d09be3cbe7d58718052cd6fa4355c.zip external_llvm-f8b81bfe608d09be3cbe7d58718052cd6fa4355c.tar.gz external_llvm-f8b81bfe608d09be3cbe7d58718052cd6fa4355c.tar.bz2 |
Use errs() instead of std::cerr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar')
-rw-r--r-- | tools/llvm-ar/llvm-ar.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index fe58db1..51f00cd 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -18,6 +18,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/PrettyStackTrace.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/System/Signals.h" #include <iostream> #include <algorithm> @@ -718,15 +719,15 @@ int main(int argc, char **argv) { if (!ArchivePath.exists()) { // Produce a warning if we should and we're creating the archive if (!Create) - std::cerr << argv[0] << ": creating " << ArchivePath.toString() << "\n"; + errs() << argv[0] << ": creating " << ArchivePath.toString() << "\n"; TheArchive = Archive::CreateEmpty(ArchivePath, Context); TheArchive->writeToDisk(); } else { std::string Error; TheArchive = Archive::OpenAndLoad(ArchivePath, Context, &Error); if (TheArchive == 0) { - std::cerr << argv[0] << ": error loading '" << ArchivePath << "': " - << Error << "!\n"; + errs() << argv[0] << ": error loading '" << ArchivePath << "': " + << Error << "!\n"; return 1; } } @@ -749,27 +750,27 @@ int main(int argc, char **argv) { case DisplayTable: haveError = doDisplayTable(&ErrMsg); break; case Extract: haveError = doExtract(&ErrMsg); break; case NoOperation: - std::cerr << argv[0] << ": No operation was selected.\n"; + errs() << argv[0] << ": No operation was selected.\n"; break; } if (haveError) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; + errs() << argv[0] << ": " << ErrMsg << "\n"; return 1; } } catch (const char*msg) { // These errors are usage errors, thrown only by the various checks in the // code above. - std::cerr << argv[0] << ": " << msg << "\n\n"; + errs() << argv[0] << ": " << msg << "\n\n"; cl::PrintHelpMessage(); exitCode = 1; } catch (const std::string& msg) { // These errors are thrown by LLVM libraries (e.g. lib System) and represent // a more serious error so we bump the exitCode and don't print the usage. - std::cerr << argv[0] << ": " << msg << "\n"; + errs() << argv[0] << ": " << msg << "\n"; exitCode = 2; } catch (...) { // This really shouldn't happen, but just in case .... - std::cerr << argv[0] << ": An unexpected unknown exception occurred.\n"; + errs() << argv[0] << ": An unexpected unknown exception occurred.\n"; exitCode = 3; } |