[llvm-commits] CVS: llvm/include/llvm/Support/Streams.h

Bill Wendling isanbard at gmail.com
Sun Nov 26 02:52:06 PST 2006



Changes in directory llvm/include/llvm/Support:

Streams.h updated: 1.1 -> 1.2
---
Log message:

Add method that will take a function pointer so that it can handle things
like "llvm_cerr << std::flush";


---
Diffs of the changes:  (+7 -0)

 Streams.h |    7 +++++++
 1 files changed, 7 insertions(+)


Index: llvm/include/llvm/Support/Streams.h
diff -u llvm/include/llvm/Support/Streams.h:1.1 llvm/include/llvm/Support/Streams.h:1.2
--- llvm/include/llvm/Support/Streams.h:1.1	Fri Nov 17 03:51:22 2006
+++ llvm/include/llvm/Support/Streams.h	Sun Nov 26 04:51:51 2006
@@ -29,6 +29,13 @@
     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;






More information about the llvm-commits mailing list