diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-07-20 18:29:44 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-07-20 18:29:44 +0000 |
commit | a7eb58378afcdf50f0afd193356dc07c017b738e (patch) | |
tree | 75e007c3b7e4852e446e9891dd15b594ffd53835 /lib/Support | |
parent | d79637b940dfbcdc0b7c702d9655491ecca9d93d (diff) | |
download | external_llvm-a7eb58378afcdf50f0afd193356dc07c017b738e.zip external_llvm-a7eb58378afcdf50f0afd193356dc07c017b738e.tar.gz external_llvm-a7eb58378afcdf50f0afd193356dc07c017b738e.tar.bz2 |
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
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/SourceMgr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index 37a9d8f..e4e01be 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -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); |