X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FStreams.h;h=445ab98c476d7711a325eb10851944a80d2f59d1;hb=0fd38069cb6699ce21eb159f22d3f23c012c9e81;hp=e9208644da4a043b995d0e7a7d16600207d0f0bb;hpb=94fb5f2a7066c427a9d3dac10a33ccbd02aac467;p=oota-llvm.git diff --git a/include/llvm/Support/Streams.h b/include/llvm/Support/Streams.h index e9208644da4..445ab98c476 100644 --- a/include/llvm/Support/Streams.h +++ b/include/llvm/Support/Streams.h @@ -24,9 +24,9 @@ namespace llvm { /// BaseStream - Acts like the STL streams. It's a wrapper for the std::cerr, /// std::cout, std::cin, etc. streams. However, it doesn't require #including - /// @verbatim @endverbatm in every file (doing so increases static + /// @verbatim @endverbatm in every file (doing so increases static /// c'tors & d'tors in the object code). - /// + /// template class BaseStream { StreamTy *Stream; @@ -64,6 +64,12 @@ namespace llvm { return *this; } + template + BaseStream &write(const Ty &A, unsigned N) { + if (Stream) Stream->write(A, N); + return *this; + } + operator StreamTy* () { return Stream; } bool operator == (const StreamTy &S) { return &S == Stream; }