mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Add method that will take a function pointer so that it can handle things
like "llvm_cerr << std::flush"; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31926 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0d45a096cf
commit
7fe9518698
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user