aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/raw_ostream.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index ea9b801f18..a91fe9b536 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/lib/Support/raw_ostream.cpp
@@ -456,6 +456,10 @@ raw_ostream &llvm::nulls() {
// raw_os_ostream
//===----------------------------------------------------------------------===//
+raw_os_ostream::~raw_os_ostream() {
+ flush();
+}
+
void raw_os_ostream::write_impl(const char *Ptr, size_t Size) {
OS.write(Ptr, Size);
}
@@ -470,6 +474,10 @@ uint64_t raw_os_ostream::tell() {
// raw_string_ostream
//===----------------------------------------------------------------------===//
+raw_string_ostream::~raw_string_ostream() {
+ flush();
+}
+
void raw_string_ostream::write_impl(const char *Ptr, size_t Size) {
OS.append(Ptr, Size);
}
@@ -478,6 +486,10 @@ void raw_string_ostream::write_impl(const char *Ptr, size_t Size) {
// raw_svector_ostream
//===----------------------------------------------------------------------===//
+raw_svector_ostream::~raw_svector_ostream() {
+ flush();
+}
+
void raw_svector_ostream::write_impl(const char *Ptr, size_t Size) {
OS.append(Ptr, Ptr + Size);
}