aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2017-02-25 17:04:23 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2017-02-25 17:04:23 +0000
commit05a75e40da0f83639111687799eaab2c07c00ef0 (patch)
tree8ade745eed4316647c5098f24acd74af027ff364 /llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
parent09ecd3117e151c645d2870409b5a78b2aeac326d (diff)
downloadllvm-05a75e40da0f83639111687799eaab2c07c00ef0.zip
llvm-05a75e40da0f83639111687799eaab2c07c00ef0.tar.gz
llvm-05a75e40da0f83639111687799eaab2c07c00ef0.tar.bz2
Revert r296215, "[PDB] General improvements to Stream library." and followings.
r296215, "[PDB] General improvements to Stream library." r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily." r296220, "Re-enable BinaryStreamTest.StreamReaderObject." r296244, "[PDB] Disable some tests that are breaking bots." r296249, "Add static_cast to silence -Wc++11-narrowing." std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission. (Seek discussions around llvm/xray.) I could substitute s/no_buffer_space/others/g, but I revert whole them ATM. Could we define and use LLVM errors there? llvm-svn: 296258
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
index 7e4f165..e1cf910 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
@@ -11,11 +11,8 @@
#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"
@@ -42,7 +39,7 @@ namespace {
typedef FixedStreamArray<support::ulittle32_t> ulittle_array;
} // end anonymous namespace
-PDBFile::PDBFile(StringRef Path, std::unique_ptr<BinaryStream> PdbFileBuffer,
+PDBFile::PDBFile(StringRef Path, std::unique_ptr<ReadableStream> PdbFileBuffer,
BumpPtrAllocator &Allocator)
: FilePath(Path), Allocator(Allocator), Buffer(std::move(PdbFileBuffer)) {}
@@ -116,7 +113,7 @@ Error PDBFile::setBlockData(uint32_t BlockIndex, uint32_t Offset,
}
Error PDBFile::parseFileHeaders() {
- BinaryStreamReader Reader(*Buffer);
+ StreamReader Reader(*Buffer);
// Initialize SB.
const msf::SuperBlock *SB = nullptr;
@@ -150,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);
- BinaryStreamReader FpmReader(*FpmStream);
+ StreamReader FpmReader(*FpmStream);
ArrayRef<uint8_t> FpmBytes;
if (auto EC = FpmReader.readBytes(FpmBytes,
msf::getFullFpmByteSize(ContainerLayout)))
@@ -188,8 +185,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);
- BinaryStreamReader Reader(*DS);
- if (auto EC = Reader.readInteger(NumStreams))
+ StreamReader Reader(*DS);
+ if (auto EC = Reader.readInteger(NumStreams, llvm::support::little))
return EC;
if (auto EC = Reader.readArray(ContainerLayout.StreamSizes, NumStreams))
@@ -353,7 +350,7 @@ Expected<StringTable &> PDBFile::getStringTable() {
if (!NS)
return NS.takeError();
- BinaryStreamReader Reader(**NS);
+ StreamReader Reader(**NS);
auto N = llvm::make_unique<StringTable>();
if (auto EC = N->load(Reader))
return std::move(EC);
@@ -406,7 +403,7 @@ bool PDBFile::hasStringTable() {
/// contain the stream returned by createIndexedStream().
Expected<std::unique_ptr<MappedBlockStream>>
PDBFile::safelyCreateIndexedStream(const MSFLayout &Layout,
- BinaryStreamRef MsfData,
+ const ReadableStream &MsfData,
uint32_t StreamIndex) const {
if (StreamIndex >= getNumStreams())
return make_error<RawError>(raw_error_code::no_stream);