diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-04-18 19:04:15 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-04-18 19:04:15 +0000 |
commit | 89f33fdb774da54d2040ec6e5e2f4a4e4e3a25b0 (patch) | |
tree | d6b49690e3fb1a1800b70eead5385081b3d0bb26 /include | |
parent | a5b0685142e8d3f5d9b6cf5aee270ebbd796c1ba (diff) | |
download | external_llvm-89f33fdb774da54d2040ec6e5e2f4a4e4e3a25b0.zip external_llvm-89f33fdb774da54d2040ec6e5e2f4a4e4e3a25b0.tar.gz external_llvm-89f33fdb774da54d2040ec6e5e2f4a4e4e3a25b0.tar.bz2 |
SourceMgr: Colorize diagnostics.
Same color scheme as clang uses. The colors are only enabled if the output is a tty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/SourceMgr.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm/Support/SourceMgr.h b/include/llvm/Support/SourceMgr.h index 58b8fab..76967db 100644 --- a/include/llvm/Support/SourceMgr.h +++ b/include/llvm/Support/SourceMgr.h @@ -128,8 +128,11 @@ public: /// PrintMessage - Emit a message about the specified location with the /// specified string. /// + /// @param ShowColors - Display colored messages if output is a terminal and + /// the default error handler is used. void PrintMessage(SMLoc Loc, DiagKind Kind, const Twine &Msg, - ArrayRef<SMRange> Ranges = ArrayRef<SMRange>()) const; + ArrayRef<SMRange> Ranges = ArrayRef<SMRange>(), + bool ShowColors = true) const; /// GetMessage - Return an SMDiagnostic at the specified location with the @@ -188,7 +191,7 @@ public: const std::vector<std::pair<unsigned, unsigned> > &getRanges() const { return Ranges; } - void print(const char *ProgName, raw_ostream &S) const; + void print(const char *ProgName, raw_ostream &S, bool ShowColors = true) const; }; } // end llvm namespace |