summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-dis/llvm-dis.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-04-21 21:11:59 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-04-21 21:11:59 +0000
commit2cd41eb0581496d79a6f462f3b7d0d5bc6655956 (patch)
tree31d787a02f5e663428944e5c3788cba55224d1ac /llvm/tools/llvm-dis/llvm-dis.cpp
parent825ead950ec7b68161bf73b987f1e2f2da05198c (diff)
downloadbcm5719-llvm-2cd41eb0581496d79a6f462f3b7d0d5bc6655956.tar.gz
bcm5719-llvm-2cd41eb0581496d79a6f462f3b7d0d5bc6655956.zip
[tools] Use WithColor for printing errors.
Use convenience helpers in WithColor to print errors, warnings and notes in a few more tools. llvm-svn: 330524
Diffstat (limited to 'llvm/tools/llvm-dis/llvm-dis.cpp')
-rw-r--r--llvm/tools/llvm-dis/llvm-dis.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp
index 0fe5257091a..f254a761f87 100644
--- a/llvm/tools/llvm-dis/llvm-dis.cpp
+++ b/llvm/tools/llvm-dis/llvm-dis.cpp
@@ -32,6 +32,7 @@
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/ToolOutputFile.h"
+#include "llvm/Support/WithColor.h"
#include <system_error>
using namespace llvm;
@@ -127,10 +128,10 @@ struct LLVMDisDiagnosticHandler : public DiagnosticHandler {
raw_ostream &OS = errs();
OS << Prefix << ": ";
switch (DI.getSeverity()) {
- case DS_Error: OS << "error: "; break;
- case DS_Warning: OS << "warning: "; break;
+ case DS_Error: WithColor::error(OS); break;
+ case DS_Warning: WithColor::warning(OS); break;
case DS_Remark: OS << "remark: "; break;
- case DS_Note: OS << "note: "; break;
+ case DS_Note: WithColor::note(OS); break;
}
DiagnosticPrinterRawOStream DP(OS);
OpenPOWER on IntegriCloud