diff options
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp index e1cf9102773..7e4f1652114 100644 --- a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp @@ -11,8 +11,11 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/STLExtras.h" #include "llvm/DebugInfo/MSF/BinaryStream.h" +#include "llvm/DebugInfo/MSF/BinaryStream.h" +#include "llvm/DebugInfo/MSF/BinaryStreamArray.h" #include "llvm/DebugInfo/MSF/BinaryStreamArray.h" #include "llvm/DebugInfo/MSF/BinaryStreamReader.h" +#include "llvm/DebugInfo/MSF/BinaryStreamReader.h" #include "llvm/DebugInfo/MSF/MSFCommon.h" #include "llvm/DebugInfo/MSF/MappedBlockStream.h" #include "llvm/DebugInfo/PDB/Native/DbiStream.h" @@ -39,7 +42,7 @@ namespace { typedef FixedStreamArray<support::ulittle32_t> ulittle_array; } // end anonymous namespace -PDBFile::PDBFile(StringRef Path, std::unique_ptr<ReadableStream> PdbFileBuffer, +PDBFile::PDBFile(StringRef Path, std::unique_ptr<BinaryStream> PdbFileBuffer, BumpPtrAllocator &Allocator) : FilePath(Path), Allocator(Allocator), Buffer(std::move(PdbFileBuffer)) {} @@ -113,7 +116,7 @@ Error PDBFile::setBlockData(uint32_t BlockIndex, uint32_t Offset, } Error PDBFile::parseFileHeaders() { - StreamReader Reader(*Buffer); + BinaryStreamReader Reader(*Buffer); // Initialize SB. const msf::SuperBlock *SB = nullptr; @@ -147,7 +150,7 @@ Error PDBFile::parseFileHeaders() { // See the function fpmPn() for more information: // https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/msf/msf.cpp#L489 auto FpmStream = MappedBlockStream::createFpmStream(ContainerLayout, *Buffer); - StreamReader FpmReader(*FpmStream); + BinaryStreamReader FpmReader(*FpmStream); ArrayRef<uint8_t> FpmBytes; if (auto EC = FpmReader.readBytes(FpmBytes, msf::getFullFpmByteSize(ContainerLayout))) @@ -185,8 +188,8 @@ Error PDBFile::parseStreamData() { // subclass of IPDBStreamData which only accesses the fields that have already // been parsed, we can avoid this and reuse MappedBlockStream. auto DS = MappedBlockStream::createDirectoryStream(ContainerLayout, *Buffer); - StreamReader Reader(*DS); - if (auto EC = Reader.readInteger(NumStreams, llvm::support::little)) + BinaryStreamReader Reader(*DS); + if (auto EC = Reader.readInteger(NumStreams)) return EC; if (auto EC = Reader.readArray(ContainerLayout.StreamSizes, NumStreams)) @@ -350,7 +353,7 @@ Expected<StringTable &> PDBFile::getStringTable() { if (!NS) return NS.takeError(); - StreamReader Reader(**NS); + BinaryStreamReader Reader(**NS); auto N = llvm::make_unique<StringTable>(); if (auto EC = N->load(Reader)) return std::move(EC); @@ -403,7 +406,7 @@ bool PDBFile::hasStringTable() { /// contain the stream returned by createIndexedStream(). Expected<std::unique_ptr<MappedBlockStream>> PDBFile::safelyCreateIndexedStream(const MSFLayout &Layout, - const ReadableStream &MsfData, + BinaryStreamRef MsfData, uint32_t StreamIndex) const { if (StreamIndex >= getNumStreams()) return make_error<RawError>(raw_error_code::no_stream); |