diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-13 17:41:40 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-13 17:41:40 +0000 |
commit | 0ba50bb05661165f2b97f4526732f109a81100b5 (patch) | |
tree | 225df6adf4d744169a033205fa269c6b8ad09f29 /include/llvm/Support/raw_ostream.h | |
parent | 208ec0f32eed8874074bddf97cd04f60a772198d (diff) | |
download | llvm-0ba50bb05661165f2b97f4526732f109a81100b5.tar.gz llvm-0ba50bb05661165f2b97f4526732f109a81100b5.tar.bz2 llvm-0ba50bb05661165f2b97f4526732f109a81100b5.tar.xz |
Set raw_os_ostream, raw_string_ostream, and raw_svector_ostream to be
unbuffered. std::ostream does its own buffering, and std::string and
SmallVector both have allocation strategies intended to handle frequent
appending.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78924 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/raw_ostream.h')
-rw-r--r-- | include/llvm/Support/raw_ostream.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h index b1b96f2316..d9110dd31d 100644 --- a/include/llvm/Support/raw_ostream.h +++ b/include/llvm/Support/raw_ostream.h @@ -376,8 +376,7 @@ class raw_os_ostream : public raw_ostream { virtual uint64_t current_pos(); public: - raw_os_ostream(std::ostream &O) : OS(O) {} - ~raw_os_ostream(); + raw_os_ostream(std::ostream &O) : raw_ostream(true), OS(O) {} /// tell - Return the current offset with the stream. uint64_t tell(); @@ -395,8 +394,7 @@ class raw_string_ostream : public raw_ostream { /// counting the bytes currently in the buffer. virtual uint64_t current_pos() { return OS.size(); } public: - explicit raw_string_ostream(std::string &O) : OS(O) {} - ~raw_string_ostream(); + explicit raw_string_ostream(std::string &O) : raw_ostream(true), OS(O) {} /// tell - Return the current offset with the stream. uint64_t tell() { return OS.size() + GetNumBytesInBuffer(); } @@ -422,8 +420,8 @@ class raw_svector_ostream : public raw_ostream { /// counting the bytes currently in the buffer. virtual uint64_t current_pos(); public: - explicit raw_svector_ostream(SmallVectorImpl<char> &O) : OS(O) {} - ~raw_svector_ostream(); + explicit raw_svector_ostream(SmallVectorImpl<char> &O) + : raw_ostream(true), OS(O) {} /// tell - Return the current offset with the stream. uint64_t tell(); |