diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2012-02-29 20:31:09 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2012-02-29 20:31:09 +0000 |
| commit | 42fcf81aba771814453b22a258418d51bf758c5a (patch) | |
| tree | a5dbcfc2c6f00788de8b06acdc9d2e9c49057391 /llvm/include | |
| parent | 60df263f54fc9bcf4253e1559362b5bbde2ac2fb (diff) | |
| download | bcm5719-llvm-42fcf81aba771814453b22a258418d51bf758c5a.tar.gz bcm5719-llvm-42fcf81aba771814453b22a258418d51bf758c5a.zip | |
BitstreamWriter: Change primary output buffer to be a SmallVector instead of an
std::vector.
- Good for 1-2% speedup on writing PCH for Cocoa.h.
- Clang side API match to follow shortly, there wasn't an easy way to make this
non-breaking.
llvm-svn: 151750
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Bitcode/BitstreamWriter.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/include/llvm/Bitcode/BitstreamWriter.h b/llvm/include/llvm/Bitcode/BitstreamWriter.h index 56b20c8474a..55e3cd390b1 100644 --- a/llvm/include/llvm/Bitcode/BitstreamWriter.h +++ b/llvm/include/llvm/Bitcode/BitstreamWriter.h @@ -16,13 +16,14 @@ #define BITSTREAM_WRITER_H #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Bitcode/BitCodes.h" #include <vector> namespace llvm { class BitstreamWriter { - std::vector<unsigned char> &Out; + SmallVectorImpl<char> &Out; /// CurBit - Always between 0 and 31 inclusive, specifies the next bit to use. unsigned CurBit; @@ -90,7 +91,7 @@ class BitstreamWriter { } public: - explicit BitstreamWriter(std::vector<unsigned char> &O) + explicit BitstreamWriter(SmallVectorImpl<char> &O) : Out(O), CurBit(0), CurValue(0), CurCodeSize(2) {} ~BitstreamWriter() { |

