mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
SourceMgr: Use has_colors() instead of just is_displayed() before trying to use
color. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160559 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -243,8 +243,8 @@ SMDiagnostic::SMDiagnostic(const SourceMgr &sm, SMLoc L, const std::string &FN,
|
|||||||
|
|
||||||
void SMDiagnostic::print(const char *ProgName, raw_ostream &S,
|
void SMDiagnostic::print(const char *ProgName, raw_ostream &S,
|
||||||
bool ShowColors) const {
|
bool ShowColors) const {
|
||||||
// Display colors only if OS goes to a tty.
|
// Display colors only if OS supports colors.
|
||||||
ShowColors &= S.is_displayed();
|
ShowColors &= S.has_colors();
|
||||||
|
|
||||||
if (ShowColors)
|
if (ShowColors)
|
||||||
S.changeColor(raw_ostream::SAVEDCOLOR, true);
|
S.changeColor(raw_ostream::SAVEDCOLOR, true);
|
||||||
|
Reference in New Issue
Block a user