diff options
Diffstat (limited to 'include/llvm/Support/Streams.h')
-rw-r--r-- | include/llvm/Support/Streams.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/Support/Streams.h b/include/llvm/Support/Streams.h index 82ffeeb..f141c92 100644 --- a/include/llvm/Support/Streams.h +++ b/include/llvm/Support/Streams.h @@ -39,6 +39,11 @@ namespace llvm { return *this; } +// inline BaseStream &operator << (std::ios &(*Func)(std::ios&)) { +// if (Stream) *Stream << Func; +// return *this; +// } + template <typename Ty> BaseStream &operator << (const Ty &Thing) { if (Stream) *Stream << Thing; @@ -51,6 +56,8 @@ namespace llvm { return *this; } + operator StreamTy* () { return Stream; } + bool operator == (const StreamTy &S) { return &S == Stream; } bool operator != (const StreamTy &S) { return !(*this == S); } bool operator == (const BaseStream &S) { return S.Stream == Stream; } @@ -61,7 +68,7 @@ namespace llvm { typedef BaseStream<std::istream> IStream; typedef BaseStream<std::stringstream> StringStream; - extern OStream NullStream; + extern OStream cnull; extern OStream cout; extern OStream cerr; extern IStream cin; |