summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Streams.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2006-11-26 10:51:51 +0000
committerBill Wendling <isanbard@gmail.com>2006-11-26 10:51:51 +0000
commit7fe9518698d4b07fb9dd81f5a34f312d690539cc (patch)
treef26d89526f669708f19ca0e93230286f1395b03d /include/llvm/Support/Streams.h
parent0d45a096cff7de5b487f7f7aac17684945dd0b93 (diff)
downloadllvm-7fe9518698d4b07fb9dd81f5a34f312d690539cc.tar.gz
llvm-7fe9518698d4b07fb9dd81f5a34f312d690539cc.tar.bz2
llvm-7fe9518698d4b07fb9dd81f5a34f312d690539cc.tar.xz
Add method that will take a function pointer so that it can handle things
like "llvm_cerr << std::flush"; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Streams.h')
-rw-r--r--include/llvm/Support/Streams.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Support/Streams.h b/include/llvm/Support/Streams.h
index 5af96fdff3..138a070149 100644
--- a/include/llvm/Support/Streams.h
+++ b/include/llvm/Support/Streams.h
@@ -29,6 +29,13 @@ namespace llvm {
llvm_ostream() : Stream(0) {}
llvm_ostream(std::ostream &OStream) : Stream(&OStream) {}
+ std::ostream* stream() const { return Stream; }
+
+ inline llvm_ostream &operator << (std::ostream& (*Func)(std::ostream&)) {
+ *Stream << Func;
+ return *this;
+ }
+
template <typename Ty>
llvm_ostream &operator << (const Ty &Thing) {
if (Stream) *Stream << Thing;