summaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/raw_ostream.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2012-07-20 18:29:41 +0000
committerDaniel Dunbar <daniel@zuster.org>2012-07-20 18:29:41 +0000
commitd79637b940dfbcdc0b7c702d9655491ecca9d93d (patch)
treef39f2045a25bb38507858228b4738ad6ecf34500 /include/llvm/Support/raw_ostream.h
parent7d83658140cb99871a43a08715a45c84aa66f3cc (diff)
downloadexternal_llvm-d79637b940dfbcdc0b7c702d9655491ecca9d93d.zip
external_llvm-d79637b940dfbcdc0b7c702d9655491ecca9d93d.tar.gz
external_llvm-d79637b940dfbcdc0b7c702d9655491ecca9d93d.tar.bz2
raw_ostream: Add a has_colors() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/raw_ostream.h')
-rw-r--r--include/llvm/Support/raw_ostream.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h
index 6c5d478..18bb31d 100644
--- a/include/llvm/Support/raw_ostream.h
+++ b/include/llvm/Support/raw_ostream.h
@@ -230,6 +230,9 @@ public:
/// rather than being put on a pipe or stored in a file.
virtual bool is_displayed() const { return false; }
+ /// This function determines if this stream is displayed and supports colors.
+ virtual bool has_colors() const { return is_displayed(); }
+
//===--------------------------------------------------------------------===//
// Subclass Interface
//===--------------------------------------------------------------------===//
@@ -386,6 +389,8 @@ public:
virtual bool is_displayed() const;
+ virtual bool has_colors() const;
+
/// has_error - Return the value of the flag in this raw_fd_ostream indicating
/// whether an output error has been encountered.
/// This doesn't implicitly flush any pending output. Also, it doesn't