summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp42
1 files changed, 6 insertions, 36 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp b/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
index 3b4e18de8f9..7a48e3d1596 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
@@ -41,9 +41,8 @@ using namespace llvm::msf;
using namespace llvm::support;
using namespace llvm::pdb;
-PublicsStream::PublicsStream(PDBFile &File,
- std::unique_ptr<MappedBlockStream> Stream)
- : Pdb(File), Stream(std::move(Stream)) {}
+PublicsStream::PublicsStream(std::unique_ptr<MappedBlockStream> Stream)
+ : Stream(std::move(Stream)) {}
PublicsStream::~PublicsStream() = default;
@@ -64,20 +63,14 @@ Error PublicsStream::reload() {
return make_error<RawError>(raw_error_code::corrupt_file,
"Publics Stream does not contain a header.");
- // Read PSGSIHDR and GSIHashHdr structs.
+ // Read PSGSIHDR struct.
if (Reader.readObject(Header))
return make_error<RawError>(raw_error_code::corrupt_file,
"Publics Stream does not contain a header.");
- if (auto EC = readGSIHashHeader(HashHdr, Reader))
- return EC;
-
- if (auto EC = readGSIHashRecords(HashRecords, HashHdr, Reader))
- return EC;
-
- if (auto EC = readGSIHashBuckets(HashBuckets, HashBitmap, HashHdr, Reader))
- return EC;
- NumBuckets = HashBuckets.size();
+ // Read the hash table.
+ if (auto E = PublicsTable.read(Reader))
+ return E;
// Something called "address map" follows.
uint32_t NumAddressMapEntries = Header->AddrMap / sizeof(uint32_t);
@@ -105,26 +98,3 @@ Error PublicsStream::reload() {
"Corrupted publics stream.");
return Error::success();
}
-
-iterator_range<codeview::CVSymbolArray::Iterator>
-PublicsStream::getSymbols(bool *HadError) const {
- auto SymbolS = Pdb.getPDBSymbolStream();
- if (SymbolS.takeError()) {
- codeview::CVSymbolArray::Iterator Iter;
- return make_range(Iter, Iter);
- }
- SymbolStream &SS = SymbolS.get();
-
- return SS.getSymbols(HadError);
-}
-
-Expected<const codeview::CVSymbolArray &>
-PublicsStream::getSymbolArray() const {
- auto SymbolS = Pdb.getPDBSymbolStream();
- if (!SymbolS)
- return SymbolS.takeError();
-
- return SymbolS->getSymbolArray();
-}
-
-Error PublicsStream::commit() { return Error::success(); }
OpenPOWER on IntegriCloud