Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 409a350

Browse files
committed
[not] Improve error reporting consistency.
Makes `not` use WithColor from Support so it prints 'error' in color when applicable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346460 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 053ebae commit 409a350

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

utils/not/not.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
// Will return true if cmd crashes (e.g. for testing crash reporting).
1414

1515
#include "llvm/Support/Program.h"
16+
#include "llvm/Support/WithColor.h"
1617
#include "llvm/Support/raw_ostream.h"
18+
1719
using namespace llvm;
1820

1921
int main(int argc, const char **argv) {
@@ -33,8 +35,8 @@ int main(int argc, const char **argv) {
3335

3436
auto Program = sys::findProgramByName(argv[0]);
3537
if (!Program) {
36-
errs() << "Error: Unable to find `" << argv[0]
37-
<< "' in PATH: " << Program.getError().message() << "\n";
38+
WithColor::error() << "unable to find `" << argv[0]
39+
<< "' in PATH: " << Program.getError().message() << "\n";
3840
return 1;
3941
}
4042

@@ -53,7 +55,7 @@ int main(int argc, const char **argv) {
5355
Result = -3;
5456
#endif
5557
if (Result < 0) {
56-
errs() << "Error: " << ErrMsg << "\n";
58+
WithColor::error() << ErrMsg << "\n";
5759
if (ExpectCrash)
5860
return 0;
5961
return 1;

0 commit comments

Comments
 (0)