diff options
author | Zachary Turner <zturner@google.com> | 2016-07-28 19:12:28 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-07-28 19:12:28 +0000 |
commit | d66889cbae749ceffca88f094274e2d64c2cb8f8 (patch) | |
tree | 81e34f9af216751ced0d50609d558d2f15277b46 /llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp | |
parent | 199f48a5f0d5aee8737880a78d81216d60cf785d (diff) | |
download | llvm-d66889cbae749ceffca88f094274e2d64c2cb8f8.zip llvm-d66889cbae749ceffca88f094274e2d64c2cb8f8.tar.gz llvm-d66889cbae749ceffca88f094274e2d64c2cb8f8.tar.bz2 |
[pdb] Refactor library to more clearly separate reading/writing
Reviewed By: amccarth, ruiu
Differential Revision: https://reviews.llvm.org/D22693
llvm-svn: 277019
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp index 6756580..a39a040 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp @@ -188,12 +188,9 @@ Error TpiStream::reload() { if (Header->HashStreamIndex >= Pdb.getNumStreams()) return make_error<RawError>(raw_error_code::corrupt_file, "Invalid TPI hash stream index."); - - auto HS = - MappedBlockStream::createIndexedStream(Header->HashStreamIndex, Pdb); - if (!HS) - return HS.takeError(); - StreamReader HSR(**HS); + auto HS = MappedBlockStream::createIndexedStream( + Pdb.getMsfLayout(), Pdb.getMsfBuffer(), Header->HashStreamIndex); + StreamReader HSR(*HS); uint32_t NumHashValues = Header->HashValueBuffer.Length / sizeof(ulittle32_t); if (NumHashValues != NumTypeRecords()) @@ -216,7 +213,7 @@ Error TpiStream::reload() { if (auto EC = HSR.readArray(HashAdjustments, NumHashAdjustments)) return EC; - HashStream = std::move(*HS); + HashStream = std::move(HS); // TPI hash table is a parallel array for the type records. // Verify that the hash values match with type records. |