summaryrefslogtreecommitdiff
path: root/lib/Support/raw_ostream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/raw_ostream.cpp')
-rw-r--r--lib/Support/raw_ostream.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index 432e603194..9827ca776a 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/lib/Support/raw_ostream.cpp
@@ -99,6 +99,12 @@ raw_ostream &raw_ostream::operator<<(long long N) {
return this->operator<<(static_cast<unsigned long long>(N));
}
+raw_ostream &raw_ostream::operator<<(const void *P) {
+ // FIXME: This could be much faster if it matters.
+ return *this << format("%p", P);
+}
+
+
raw_ostream &raw_ostream::write(const char *Ptr, unsigned Size) {
if (OutBufCur+Size > OutBufEnd)
flush_impl();
@@ -250,6 +256,10 @@ raw_ostream &llvm::errs() {
// raw_os_ostream
//===----------------------------------------------------------------------===//
+raw_os_ostream::~raw_os_ostream() {
+ flush();
+}
+
/// flush_impl - The is the piece of the class that is implemented by
/// subclasses. This outputs the currently buffered data and resets the
/// buffer to empty.