mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 22:30:33 +00:00
SourceMgr: Use has_colors() instead of just is_displayed() before trying to use
color. llvm-svn: 160559
This commit is contained in:
parent
76b9c78855
commit
2e8b52dffd
@ -243,8 +243,8 @@ SMDiagnostic::SMDiagnostic(const SourceMgr &sm, SMLoc L, const std::string &FN,
|
||||
|
||||
void SMDiagnostic::print(const char *ProgName, raw_ostream &S,
|
||||
bool ShowColors) const {
|
||||
// Display colors only if OS goes to a tty.
|
||||
ShowColors &= S.is_displayed();
|
||||
// Display colors only if OS supports colors.
|
||||
ShowColors &= S.has_colors();
|
||||
|
||||
if (ShowColors)
|
||||
S.changeColor(raw_ostream::SAVEDCOLOR, true);
|
||||
|
Loading…
Reference in New Issue
Block a user