aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/BinaryStreamWriter.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-11-27 18:48:37 +0000
committerZachary Turner <zturner@google.com>2017-11-27 18:48:37 +0000
commit96c6985b5327845be772c2bc13567c2967969cc7 (patch)
tree630b1fba2331a97d751864515dfa76eb6f168d15 /llvm/lib/Support/BinaryStreamWriter.cpp
parentec6e21427275ce1cdb2580aaa4167b143aab049c (diff)
downloadllvm-96c6985b5327845be772c2bc13567c2967969cc7.zip
llvm-96c6985b5327845be772c2bc13567c2967969cc7.tar.gz
llvm-96c6985b5327845be772c2bc13567c2967969cc7.tar.bz2
[BinaryStream] Support growable streams.
The existing library assumed that a stream's length would never change. This makes some things simpler, but it's not flexible enough for what we need, especially for writable streams where what you really want is for each call to write to actually append. llvm-svn: 319070
Diffstat (limited to 'llvm/lib/Support/BinaryStreamWriter.cpp')
-rw-r--r--llvm/lib/Support/BinaryStreamWriter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/BinaryStreamWriter.cpp b/llvm/lib/Support/BinaryStreamWriter.cpp
index c427651..bfad128 100644
--- a/llvm/lib/Support/BinaryStreamWriter.cpp
+++ b/llvm/lib/Support/BinaryStreamWriter.cpp
@@ -42,7 +42,8 @@ Error BinaryStreamWriter::writeCString(StringRef Str) {
}
Error BinaryStreamWriter::writeFixedString(StringRef Str) {
- return writeBytes(ArrayRef<uint8_t>(Str.bytes_begin(), Str.bytes_end()));
+
+ return writeBytes(arrayRefFromStringRef(Str));
}
Error BinaryStreamWriter::writeStreamRef(BinaryStreamRef Ref) {