summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/MSF/MappedBlockStreamTest.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/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp
parentec6e21427275ce1cdb2580aaa4167b143aab049c (diff)
downloadbcm5719-llvm-96c6985b5327845be772c2bc13567c2967969cc7.tar.gz
bcm5719-llvm-96c6985b5327845be772c2bc13567c2967969cc7.zip
[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/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp')
-rw-r--r--llvm/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp b/llvm/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp
index 3a3937e3405..ee52a091567 100644
--- a/llvm/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp
+++ b/llvm/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp
@@ -42,7 +42,7 @@ public:
Error readBytes(uint32_t Offset, uint32_t Size,
ArrayRef<uint8_t> &Buffer) override {
- if (auto EC = checkOffset(Offset, Size))
+ if (auto EC = checkOffsetForRead(Offset, Size))
return EC;
Buffer = Data.slice(Offset, Size);
return Error::success();
@@ -50,7 +50,7 @@ public:
Error readLongestContiguousChunk(uint32_t Offset,
ArrayRef<uint8_t> &Buffer) override {
- if (auto EC = checkOffset(Offset, 1))
+ if (auto EC = checkOffsetForRead(Offset, 1))
return EC;
Buffer = Data.drop_front(Offset);
return Error::success();
@@ -59,7 +59,7 @@ public:
uint32_t getLength() override { return Data.size(); }
Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> SrcData) override {
- if (auto EC = checkOffset(Offset, SrcData.size()))
+ if (auto EC = checkOffsetForWrite(Offset, SrcData.size()))
return EC;
::memcpy(&Data[Offset], SrcData.data(), SrcData.size());
return Error::success();
OpenPOWER on IntegriCloud