[llvm] r335416 - [llvm-mt] Use WithColor for printing errors.

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 23 09:49:07 PDT 2018


Author: jdevlieghere
Date: Sat Jun 23 09:49:07 2018
New Revision: 335416

URL: http://llvm.org/viewvc/llvm-project?rev=335416&view=rev
Log:
[llvm-mt] Use WithColor for printing errors.

Use the WithColor helper from support to print errors.

Modified:
    llvm/trunk/test/tools/llvm-mt/conflicting.test
    llvm/trunk/test/tools/llvm-mt/help.test
    llvm/trunk/test/tools/llvm-mt/xml_error.test
    llvm/trunk/tools/llvm-mt/llvm-mt.cpp

Modified: llvm/trunk/test/tools/llvm-mt/conflicting.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mt/conflicting.test?rev=335416&r1=335415&r2=335416&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mt/conflicting.test (original)
+++ llvm/trunk/test/tools/llvm-mt/conflicting.test Sat Jun 23 09:49:07 2018
@@ -4,4 +4,4 @@ UNSUPPORTED: system-windows
 RUN: not llvm-mt /manifest %p/Inputs/test_manifest.manifest /manifest \
 RUN:   %p/Inputs/conflicting.manifest /out:%t 2>&1 >/dev/null | FileCheck %s
 
-CHECK: llvm-mt error: conflicting attributes for requestedExecutionLevel
+CHECK: llvm-mt: error: conflicting attributes for requestedExecutionLevel

Modified: llvm/trunk/test/tools/llvm-mt/help.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mt/help.test?rev=335416&r1=335415&r2=335416&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mt/help.test (original)
+++ llvm/trunk/test/tools/llvm-mt/help.test Sat Jun 23 09:49:07 2018
@@ -3,8 +3,8 @@ RUN: llvm-mt /h | FileCheck %s -check-pr
 HELP:      OVERVIEW: Manifest Tool
 
 RUN: not llvm-mt /foo 2>&1 >/dev/null | FileCheck %s -check-prefix=INVALID
-INVALID: llvm-mt error: invalid option '/foo'
+INVALID: llvm-mt: error: invalid option '/foo'
 
 RUN: not llvm-mt /oyt:%t 2>&1 | FileCheck %s -check-prefix=INVALID-BUT-CLOSE
-INVALID-BUT-CLOSE: llvm-mt error: invalid option '/oyt:{{.*}}help.test.tmp', did you mean '/out:{{.*}}help.test.tmp'?
+INVALID-BUT-CLOSE: llvm-mt: error: invalid option '/oyt:{{.*}}help.test.tmp', did you mean '/out:{{.*}}help.test.tmp'?
 

Modified: llvm/trunk/test/tools/llvm-mt/xml_error.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mt/xml_error.test?rev=335416&r1=335415&r2=335416&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mt/xml_error.test (original)
+++ llvm/trunk/test/tools/llvm-mt/xml_error.test Sat Jun 23 09:49:07 2018
@@ -4,12 +4,12 @@ UNSUPPORTED: system-windows
 RUN: not llvm-mt /manifest %p/Inputs/bad.manifest 2>&1 >/dev/null | FileCheck \
 RUN:   %s
 
-CHECK: llvm-mt error: invalid xml document
+CHECK: llvm-mt: error: invalid xml document
 
 RUN: not llvm-mt /manifest %p/Inputs/empty.manifest 2>&1 >/dev/null | \
 RUN:   FileCheck %s -check-prefix=EMPTY
 
-EMPTY: llvm-mt error: attempted to merge empty manifest
+EMPTY: llvm-mt: error: attempted to merge empty manifest
 
 RUN: llvm-mt /inputresource:foo.res \
 RUN:   /manifest %p/Inputs/test_manifest.manifest \

Modified: llvm/trunk/tools/llvm-mt/llvm-mt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mt/llvm-mt.cpp?rev=335416&r1=335415&r2=335416&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mt/llvm-mt.cpp (original)
+++ llvm/trunk/tools/llvm-mt/llvm-mt.cpp Sat Jun 23 09:49:07 2018
@@ -24,6 +24,7 @@
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/Process.h"
 #include "llvm/Support/Signals.h"
+#include "llvm/Support/WithColor.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/WindowsManifest/WindowsManifestMerger.h"
 
@@ -65,7 +66,7 @@ public:
 } // namespace
 
 LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg) {
-  errs() << "llvm-mt error: " << Msg << "\n";
+  WithColor::error(errs(), "llvm-mt") << Msg << '\n';
   exit(1);
 }
 




More information about the llvm-commits mailing list