diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-08-19 17:54:29 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-19 17:54:29 +0000 |
| commit | 7dfa741b135d49ffccf3cc03e9c6fdf43b2865f7 (patch) | |
| tree | d49acf322133866d49b89f7145bab83860305af3 /include/llvm | |
| parent | ce6ced48cea695b57c2ea292a97764fc8fd4aa2f (diff) | |
| download | external_llvm-7dfa741b135d49ffccf3cc03e9c6fdf43b2865f7.zip external_llvm-7dfa741b135d49ffccf3cc03e9c6fdf43b2865f7.tar.gz external_llvm-7dfa741b135d49ffccf3cc03e9c6fdf43b2865f7.tar.bz2 | |
Switch raw_svector_ostream to use the vector as the ostream buffer.
- This avoids unnecessary malloc/free overhead in the common case, and
unnecessary copying from the ostream buffer into the output vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
| -rw-r--r-- | include/llvm/Support/raw_ostream.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h index 1668cc5..ed06dbf 100644 --- a/include/llvm/Support/raw_ostream.h +++ b/include/llvm/Support/raw_ostream.h @@ -452,6 +452,10 @@ class raw_svector_ostream : public raw_ostream { /// counting the bytes currently in the buffer. virtual uint64_t current_pos(); public: + /// Construct a new raw_svector_ostream. + /// + /// \arg O - The vector to write to; this *must* have at least 128 bytes of + /// free space in it. explicit raw_svector_ostream(SmallVectorImpl<char> &O); ~raw_svector_ostream(); }; |
