[llvm-commits] [llvm] r160559 - /llvm/trunk/lib/Support/SourceMgr.cpp
Daniel Dunbar
daniel at zuster.org
Fri Jul 20 11:29:44 PDT 2012
Author: ddunbar
Date: Fri Jul 20 13:29:44 2012
New Revision: 160559
URL: http://llvm.org/viewvc/llvm-project?rev=160559&view=rev
Log:
SourceMgr: Use has_colors() instead of just is_displayed() before trying to use
color.
Modified:
llvm/trunk/lib/Support/SourceMgr.cpp
Modified: llvm/trunk/lib/Support/SourceMgr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SourceMgr.cpp?rev=160559&r1=160558&r2=160559&view=diff
==============================================================================
--- llvm/trunk/lib/Support/SourceMgr.cpp (original)
+++ llvm/trunk/lib/Support/SourceMgr.cpp Fri Jul 20 13:29:44 2012
@@ -243,8 +243,8 @@
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);
More information about the llvm-commits
mailing list