diff options
| author | Zachary Turner <zturner@google.com> | 2016-09-14 23:00:02 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2016-09-14 23:00:02 +0000 |
| commit | 620961deb9bc4c0415d56bed9b2fe20391bd2ad2 (patch) | |
| tree | c313b23899ec22d2871cedecf1b65b93905cfa3b /llvm/lib/DebugInfo/MSF | |
| parent | 31263731da2214579540198ae96c0990b315d0ed (diff) | |
| download | bcm5719-llvm-620961deb9bc4c0415d56bed9b2fe20391bd2ad2.tar.gz bcm5719-llvm-620961deb9bc4c0415d56bed9b2fe20391bd2ad2.zip | |
[pdb] Write TPI hash values to the TPI stream.
This completes being able to write all the interesting
values of a PDB TPI stream.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24370
llvm-svn: 281555
Diffstat (limited to 'llvm/lib/DebugInfo/MSF')
| -rw-r--r-- | llvm/lib/DebugInfo/MSF/MSFBuilder.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/MSF/MSFBuilder.cpp b/llvm/lib/DebugInfo/MSF/MSFBuilder.cpp index 22195a8ec29..0b378db51ff 100644 --- a/llvm/lib/DebugInfo/MSF/MSFBuilder.cpp +++ b/llvm/lib/DebugInfo/MSF/MSFBuilder.cpp @@ -122,7 +122,8 @@ uint32_t MSFBuilder::getTotalBlockCount() const { return FreeBlocks.size(); } bool MSFBuilder::isBlockFree(uint32_t Idx) const { return FreeBlocks[Idx]; } -Error MSFBuilder::addStream(uint32_t Size, ArrayRef<uint32_t> Blocks) { +Expected<uint32_t> MSFBuilder::addStream(uint32_t Size, + ArrayRef<uint32_t> Blocks) { // Add a new stream mapped to the specified blocks. Verify that the specified // blocks are both necessary and sufficient for holding the requested number // of bytes, and verify that all requested blocks are free. @@ -145,17 +146,17 @@ Error MSFBuilder::addStream(uint32_t Size, ArrayRef<uint32_t> Blocks) { FreeBlocks.reset(Block); } StreamData.push_back(std::make_pair(Size, Blocks)); - return Error::success(); + return StreamData.size() - 1; } -Error MSFBuilder::addStream(uint32_t Size) { +Expected<uint32_t> MSFBuilder::addStream(uint32_t Size) { uint32_t ReqBlocks = bytesToBlocks(Size, BlockSize); std::vector<uint32_t> NewBlocks; NewBlocks.resize(ReqBlocks); if (auto EC = allocateBlocks(ReqBlocks, NewBlocks)) - return EC; + return std::move(EC); StreamData.push_back(std::make_pair(Size, NewBlocks)); - return Error::success(); + return StreamData.size() - 1; } Error MSFBuilder::setStreamSize(uint32_t Idx, uint32_t Size) { |

