1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Add method that will take a function pointer so that it can handle things

like "llvm_cerr << std::flush";

llvm-svn: 31926
This commit is contained in:
Bill Wendling 2006-11-26 10:51:51 +00:00
parent 999f49061f
commit 78be822ec4

View File

@ -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;