diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-09 01:17:22 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-09 01:17:22 +0000 |
commit | 86ef28f1a20b294ca657cfa3dda2a85f376b1f98 (patch) | |
tree | c16e6507c7ba07ecc9d942a98b57af4493af4325 /llvm/utils/not/not.cpp | |
parent | eb987742991b49dea4b04ad7f518c8bde1b84446 (diff) | |
download | bcm5719-llvm-86ef28f1a20b294ca657cfa3dda2a85f376b1f98.tar.gz bcm5719-llvm-86ef28f1a20b294ca657cfa3dda2a85f376b1f98.zip |
[not] Improve error reporting consistency.
Makes `not` use WithColor from Support so it prints 'error' in color
when applicable.
llvm-svn: 346460
Diffstat (limited to 'llvm/utils/not/not.cpp')
-rw-r--r-- | llvm/utils/not/not.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/utils/not/not.cpp b/llvm/utils/not/not.cpp index f48079d8875..e35c884944c 100644 --- a/llvm/utils/not/not.cpp +++ b/llvm/utils/not/not.cpp @@ -13,7 +13,9 @@ // Will return true if cmd crashes (e.g. for testing crash reporting). #include "llvm/Support/Program.h" +#include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" + using namespace llvm; int main(int argc, const char **argv) { @@ -33,8 +35,8 @@ int main(int argc, const char **argv) { auto Program = sys::findProgramByName(argv[0]); if (!Program) { - errs() << "Error: Unable to find `" << argv[0] - << "' in PATH: " << Program.getError().message() << "\n"; + WithColor::error() << "unable to find `" << argv[0] + << "' in PATH: " << Program.getError().message() << "\n"; return 1; } @@ -53,7 +55,7 @@ int main(int argc, const char **argv) { Result = -3; #endif if (Result < 0) { - errs() << "Error: " << ErrMsg << "\n"; + WithColor::error() << ErrMsg << "\n"; if (ExpectCrash) return 0; return 1; |