llvm.org GIT mirror llvm / 409a350
[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 Jonas Devlieghere 11 months ago
1 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1212 // Will return true if cmd crashes (e.g. for testing crash reporting).
1313
1414 #include "llvm/Support/Program.h"
15 #include "llvm/Support/WithColor.h"
1516 #include "llvm/Support/raw_ostream.h"
17
1618 using namespace llvm;
1719
1820 int main(int argc, const char **argv) {
3234
3335 auto Program = sys::findProgramByName(argv[0]);
3436 if (!Program) {
35 errs() << "Error: Unable to find `" << argv[0]
36 << "' in PATH: " << Program.getError().message() << "\n";
37 WithColor::error() << "unable to find `" << argv[0]
38 << "' in PATH: " << Program.getError().message() << "\n";
3739 return 1;
3840 }
3941
5254 Result = -3;
5355 #endif
5456 if (Result < 0) {
55 errs() << "Error: " << ErrMsg << "\n";
57 WithColor::error() << ErrMsg << "\n";
5658 if (ExpectCrash)
5759 return 0;
5860 return 1;