diff options
| author | Roman Lebedev <lebedev.ri@gmail.com> | 2019-02-25 21:11:19 +0000 |
|---|---|---|
| committer | Roman Lebedev <lebedev.ri@gmail.com> | 2019-02-25 21:11:19 +0000 |
| commit | 6da94438902e2dcc8ebfa0f8086cf584a54abc80 (patch) | |
| tree | 373665cce8d78651fbe2721b922fa77cbe267b29 | |
| parent | 7166ab47045e64bcf3178a7d2be47d77700f6564 (diff) | |
| download | bcm5719-llvm-6da94438902e2dcc8ebfa0f8086cf584a54abc80.tar.gz bcm5719-llvm-6da94438902e2dcc8ebfa0f8086cf584a54abc80.zip | |
Revert "[Support] Make raw_string_ostream unbuffered"
Shame on me, did not run all the tests, bots are angry.
This reverts commit r354819.
llvm-svn: 354822
| -rw-r--r-- | llvm/include/llvm/Support/raw_ostream.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h index 199dfe2844f..48bb623b063 100644 --- a/llvm/include/llvm/Support/raw_ostream.h +++ b/llvm/include/llvm/Support/raw_ostream.h @@ -479,9 +479,6 @@ raw_ostream &nulls(); /// A raw_ostream that writes to an std::string. This is a simple adaptor /// class. This class does not encounter output errors. -/// raw_string_ostream operates without a buffer, delegating all memory -/// management to the std::string. Thus the std::string is always up-to-date, -/// may be used directly and there is no need to call flush(). class raw_string_ostream : public raw_ostream { std::string &OS; @@ -493,16 +490,13 @@ class raw_string_ostream : public raw_ostream { uint64_t current_pos() const override { return OS.size(); } public: - explicit raw_string_ostream(std::string &O) - : raw_ostream(/*Unbuffered=*/true), OS(O) {} - + explicit raw_string_ostream(std::string &O) : OS(O) {} ~raw_string_ostream() override; - // FIXME: uncomment and deal with the fallout. - // void flush() = delete; - - /// Returns the string's reference. + /// Flushes the stream contents to the target string and returns the string's + /// reference. std::string& str() { + flush(); return OS; } }; |

