diff options
-rw-r--r-- | include/llvm/Support/Streams.h | 7 |
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; |