summaryrefslogtreecommitdiff
path: root/include/llvm/Support/raw_ostream.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-16 21:17:53 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-16 21:17:53 +0000
commit34ccf037fea3d83dcb18f72496775ec4c7dcd3d3 (patch)
tree4f75f7867037c4f79ccc87b69abeee324a26f445 /include/llvm/Support/raw_ostream.h
parent32360a7e21a4454aa7014992213823fb4319905a (diff)
downloadllvm-34ccf037fea3d83dcb18f72496775ec4c7dcd3d3.tar.gz
llvm-34ccf037fea3d83dcb18f72496775ec4c7dcd3d3.tar.bz2
llvm-34ccf037fea3d83dcb18f72496775ec4c7dcd3d3.tar.xz
Add raw_null_ostream and llvm::nulls(), a raw_ostream that discards output.
- No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/raw_ostream.h')
-rw-r--r--include/llvm/Support/raw_ostream.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h
index aeeb7e3abc..4c7338eac4 100644
--- a/include/llvm/Support/raw_ostream.h
+++ b/include/llvm/Support/raw_ostream.h
@@ -327,6 +327,9 @@ raw_ostream &outs();
/// Use it like: errs() << "foo" << "bar";
raw_ostream &errs();
+/// nulls() - This returns a reference to a raw_ostream which simply discards
+/// output.
+raw_ostream &nulls();
//===----------------------------------------------------------------------===//
// Output Stream Adaptors
@@ -399,6 +402,19 @@ public:
uint64_t tell();
};
+/// raw_null_ostream - A raw_ostream that discards all output.
+class raw_null_ostream : public raw_ostream {
+ /// write_impl - See raw_ostream::write_impl.
+ virtual void write_impl(const char *Ptr, size_t size);
+
+ /// current_pos - Return the current position within the stream, not
+ /// counting the bytes currently in the buffer.
+ virtual uint64_t current_pos();
+
+public:
+ explicit raw_null_ostream() {}
+};
+
} // end llvm namespace
#endif