diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2017-02-25 17:04:23 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2017-02-25 17:04:23 +0000 |
commit | 05a75e40da0f83639111687799eaab2c07c00ef0 (patch) | |
tree | 8ade745eed4316647c5098f24acd74af027ff364 /llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp | |
parent | 09ecd3117e151c645d2870409b5a78b2aeac326d (diff) | |
download | bcm5719-llvm-05a75e40da0f83639111687799eaab2c07c00ef0.tar.gz bcm5719-llvm-05a75e40da0f83639111687799eaab2c07c00ef0.zip |
Revert r296215, "[PDB] General improvements to Stream library." and followings.
r296215, "[PDB] General improvements to Stream library."
r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily."
r296220, "Re-enable BinaryStreamTest.StreamReaderObject."
r296244, "[PDB] Disable some tests that are breaking bots."
r296249, "Add static_cast to silence -Wc++11-narrowing."
std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission.
(Seek discussions around llvm/xray.)
I could substitute s/no_buffer_space/others/g, but I revert whole them ATM.
Could we define and use LLVM errors there?
llvm-svn: 296258
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp index 7d532ee56d8..29c1ec00fc7 100644 --- a/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp @@ -34,8 +34,7 @@ using namespace llvm::pdb; using namespace llvm::support; TpiStreamBuilder::TpiStreamBuilder(MSFBuilder &Msf, uint32_t StreamIdx) - : Msf(Msf), Allocator(Msf.getAllocator()), - TypeRecordStream(llvm::support::little), Header(nullptr), Idx(StreamIdx) { + : Msf(Msf), Allocator(Msf.getAllocator()), Header(nullptr), Idx(StreamIdx) { } TpiStreamBuilder::~TpiStreamBuilder() = default; @@ -83,7 +82,7 @@ Error TpiStreamBuilder::finalize() { return Error::success(); } -uint32_t TpiStreamBuilder::calculateSerializedLength() { +uint32_t TpiStreamBuilder::calculateSerializedLength() const { return sizeof(TpiStreamHeader) + TypeRecordStream.getLength(); } @@ -114,20 +113,19 @@ Error TpiStreamBuilder::finalizeMsfLayout() { } ArrayRef<uint8_t> Bytes(reinterpret_cast<const uint8_t *>(HashBuffer.data()), HashBufferSize); - HashValueStream = - llvm::make_unique<BinaryByteStream>(Bytes, llvm::support::little); + HashValueStream = llvm::make_unique<ByteStream>(Bytes); return Error::success(); } Error TpiStreamBuilder::commit(const msf::MSFLayout &Layout, - WritableBinaryStreamRef Buffer) { + const msf::WritableStream &Buffer) { if (auto EC = finalize()) return EC; auto InfoS = WritableMappedBlockStream::createIndexedStream(Layout, Buffer, Idx); - BinaryStreamWriter Writer(*InfoS); + StreamWriter Writer(*InfoS); if (auto EC = Writer.writeObject(*Header)) return EC; @@ -138,7 +136,7 @@ Error TpiStreamBuilder::commit(const msf::MSFLayout &Layout, if (HashStreamIndex != kInvalidStreamIndex) { auto HVS = WritableMappedBlockStream::createIndexedStream(Layout, Buffer, HashStreamIndex); - BinaryStreamWriter HW(*HVS); + StreamWriter HW(*HVS); if (auto EC = HW.writeStreamRef(*HashValueStream)) return EC; } |