diff options
| author | Bill Wendling <isanbard@gmail.com> | 2006-11-26 10:51:51 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2006-11-26 10:51:51 +0000 |
| commit | a88968b9c456e3c47403c7e0bb3a8d94f980d0b5 (patch) | |
| tree | 81b425e32f8ca86660af29fbf338fe52cdd14429 /llvm | |
| parent | 4ae401074ccbef0c632e06aa24f0c82811ce1f38 (diff) | |
| download | bcm5719-llvm-a88968b9c456e3c47403c7e0bb3a8d94f980d0b5.tar.gz bcm5719-llvm-a88968b9c456e3c47403c7e0bb3a8d94f980d0b5.zip | |
Add method that will take a function pointer so that it can handle things
like "llvm_cerr << std::flush";
llvm-svn: 31926
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Support/Streams.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/Streams.h b/llvm/include/llvm/Support/Streams.h index 5af96fdff3a..138a0701497 100644 --- a/llvm/include/llvm/Support/Streams.h +++ b/llvm/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; |

