diff options
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp b/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp index b4f217abf85..e9ae5a1a193 100644 --- a/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp @@ -21,19 +21,18 @@ using namespace llvm::msf; using namespace llvm::pdb; InfoStream::InfoStream(std::unique_ptr<MappedBlockStream> Stream) - : Stream(std::move(Stream)) {} + : Stream(std::move(Stream)), Header(nullptr) {} Error InfoStream::reload() { BinaryStreamReader Reader(*Stream); - const InfoStreamHeader *H; - if (auto EC = Reader.readObject(H)) + if (auto EC = Reader.readObject(Header)) return joinErrors( std::move(EC), make_error<RawError>(raw_error_code::corrupt_file, "PDB Stream does not contain a header.")); - switch (H->Version) { + switch (Header->Version) { case PdbImplVC70: case PdbImplVC80: case PdbImplVC110: @@ -44,11 +43,6 @@ Error InfoStream::reload() { "Unsupported PDB stream version."); } - Version = H->Version; - Signature = H->Signature; - Age = H->Age; - Guid = H->Guid; - uint32_t Offset = Reader.getOffset(); if (auto EC = NamedStreams.load(Reader)) return EC; @@ -108,14 +102,16 @@ bool InfoStream::containsIdStream() const { } PdbRaw_ImplVer InfoStream::getVersion() const { - return static_cast<PdbRaw_ImplVer>(Version); + return static_cast<PdbRaw_ImplVer>(uint32_t(Header->Version)); } -uint32_t InfoStream::getSignature() const { return Signature; } +uint32_t InfoStream::getSignature() const { + return uint32_t(Header->Signature); +} -uint32_t InfoStream::getAge() const { return Age; } +uint32_t InfoStream::getAge() const { return uint32_t(Header->Age); } -GUID InfoStream::getGuid() const { return Guid; } +GUID InfoStream::getGuid() const { return Header->Guid; } uint32_t InfoStream::getNamedStreamMapByteSize() const { return NamedStreamMapByteSize; |