diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-06-23 16:48:03 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-06-23 16:48:03 +0000 |
commit | c02bf01f64a977a7e39d379afe449ab769893aa8 (patch) | |
tree | af6679f17d511d14afb44724c3cde0ab8381f2be /llvm/lib/TableGen | |
parent | d8d64a56b59ae174bb1322e89adec6b3ded8d2ff (diff) | |
download | bcm5719-llvm-c02bf01f64a977a7e39d379afe449ab769893aa8.tar.gz bcm5719-llvm-c02bf01f64a977a7e39d379afe449ab769893aa8.zip |
[TableGen] Use WithColor for printing errors/warnings
Use the WithColor helper from support to print errors and warnings.
llvm-svn: 335415
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r-- | llvm/lib/TableGen/Error.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/TableGen/Error.cpp b/llvm/lib/TableGen/Error.cpp index b4830178a26..e6171c71efc 100644 --- a/llvm/lib/TableGen/Error.cpp +++ b/llvm/lib/TableGen/Error.cpp @@ -15,6 +15,7 @@ #include "llvm/TableGen/Error.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/Signals.h" +#include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" #include <cstdlib> @@ -51,9 +52,7 @@ void PrintWarning(const char *Loc, const Twine &Msg) { SrcMgr.PrintMessage(SMLoc::getFromPointer(Loc), SourceMgr::DK_Warning, Msg); } -void PrintWarning(const Twine &Msg) { - errs() << "warning:" << Msg << "\n"; -} +void PrintWarning(const Twine &Msg) { WithColor::warning() << Msg << "\n"; } void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg) { PrintMessage(ErrorLoc, SourceMgr::DK_Error, Msg); @@ -63,9 +62,7 @@ void PrintError(const char *Loc, const Twine &Msg) { SrcMgr.PrintMessage(SMLoc::getFromPointer(Loc), SourceMgr::DK_Error, Msg); } -void PrintError(const Twine &Msg) { - errs() << "error:" << Msg << "\n"; -} +void PrintError(const Twine &Msg) { WithColor::error() << Msg << "\n"; } void PrintFatalError(const Twine &Msg) { PrintError(Msg); |