From d5fa059858cbe65f1d43d3e2e9e124d48356a0f5 Mon Sep 17 00:00:00 2001 From: "Troy A. Johnson" Date: Sat, 17 Aug 2019 14:20:41 +0000 Subject: [PATCH] [circular_raw_ostream] Delegate is_displayed to contained stream raw_ostream has an is_displayed() member function that determines if the stream is connected to a console for display or is connected to a file/pipe. By default, is_displayed() returns false, and derived classes like raw_fd_ostream override it. Because circular_raw_ostream wraps another stream, its result for is_displayed() should be the same as that stream. Differential Revision: https://reviews.llvm.org/D66026 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369188 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/circular_raw_ostream.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/llvm/Support/circular_raw_ostream.h b/include/llvm/Support/circular_raw_ostream.h index 4ecdb17376f..a72acd4fe00 100644 --- a/include/llvm/Support/circular_raw_ostream.h +++ b/include/llvm/Support/circular_raw_ostream.h @@ -122,6 +122,10 @@ namespace llvm { delete[] BufferArray; } + bool is_displayed() const override { + return TheStream->is_displayed(); + } + /// setStream - Tell the circular_raw_ostream to output a /// different stream. "Owns" tells circular_raw_ostream whether /// it should take responsibility for managing the underlying -- 2.40.0