summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-02-27 22:11:43 +0000
committerZachary Turner <zturner@google.com>2017-02-27 22:11:43 +0000
commit120faca41bddd3a5922bdefbeb7c68908fda9ab9 (patch)
treee3c36b67c61a5021ed8847241cfaf9c59b48309a /llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
parent4a7cc16e89b68d48335e7cd19837c3e67e12afb2 (diff)
downloadbcm5719-llvm-120faca41bddd3a5922bdefbeb7c68908fda9ab9.tar.gz
bcm5719-llvm-120faca41bddd3a5922bdefbeb7c68908fda9ab9.zip
[PDB] Partial resubmit of r296215, which improved PDB Stream Library.
This was reverted because it was breaking some builds, and because of incorrect error code usage. Since the CL was large and contained many different things, I'm resubmitting it in pieces. This portion is NFC, and consists of: 1) Renaming classes to follow a consistent naming convention. 2) Fixing the const-ness of the interface methods. 3) Adding detailed doxygen comments. 4) Fixing a few instances of passing `const BinaryStream& X`. These are now passed as `BinaryStreamRef X`. llvm-svn: 296394
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
index e1cf9102773..a08ecd0487e 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
@@ -39,7 +39,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 +113,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 +147,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,7 +185,7 @@ 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);
+ BinaryStreamReader Reader(*DS);
if (auto EC = Reader.readInteger(NumStreams, llvm::support::little))
return EC;
@@ -350,7 +350,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 +403,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);
OpenPOWER on IntegriCloud