summaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/SystemUtils.cpp3
-rw-r--r--lib/Support/raw_ostream.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/Support/SystemUtils.cpp b/lib/Support/SystemUtils.cpp
index 3d3649eaeb..299032f187 100644
--- a/lib/Support/SystemUtils.cpp
+++ b/lib/Support/SystemUtils.cpp
@@ -20,8 +20,7 @@ using namespace llvm;
bool llvm::CheckBitcodeOutputToConsole(raw_ostream &stream_to_check,
bool print_warning) {
- if (&stream_to_check == &outs() &&
- sys::Process::StandardOutIsDisplayed()) {
+ if (stream_to_check.is_displayed()) {
if (print_warning) {
errs() << "WARNING: You're attempting to print out a bitcode file.\n"
<< "This is inadvisable as it may cause display problems. If\n"
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index a229efde6e..2cb3771287 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/lib/Support/raw_ostream.cpp
@@ -454,6 +454,10 @@ raw_ostream &raw_fd_ostream::resetColor() {
return *this;
}
+bool raw_fd_ostream::is_displayed() const {
+ return sys::Process::FileDescriptorIsDisplayed(FD);
+}
+
//===----------------------------------------------------------------------===//
// raw_stdout/err_ostream
//===----------------------------------------------------------------------===//