diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-06-03 18:18:34 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-06-03 18:18:34 +0000 |
| commit | 6d97bb297c123377182a5d78b412be5c1d723e08 (patch) | |
| tree | 5e57003ce58361eb4909e2a22461b096529d726f /contrib/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp | |
| parent | 4224465e820a1a7232255d980e692720169776af (diff) | |
| parent | d288ef4c1788d3a951a7558c68312c2d320612b1 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp')
| -rw-r--r-- | contrib/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/contrib/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp b/contrib/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp index d7a203746a0d..c4ff30011a17 100644 --- a/contrib/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp +++ b/contrib/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp @@ -55,9 +55,9 @@ Error ModuleDebugStreamRef::reload() { if (auto EC = Reader.readStreamRef(C13LinesSubstream, C13Size)) return EC; - BinaryStreamReader LineReader(C13LinesSubstream); - if (auto EC = - LineReader.readArray(LinesAndChecksums, LineReader.bytesRemaining())) + BinaryStreamReader SubsectionsReader(C13LinesSubstream); + if (auto EC = SubsectionsReader.readArray(Subsections, + SubsectionsReader.bytesRemaining())) return EC; uint32_t GlobalRefsSize; @@ -77,13 +77,27 @@ ModuleDebugStreamRef::symbols(bool *HadError) const { return make_range(SymbolsSubstream.begin(HadError), SymbolsSubstream.end()); } -llvm::iterator_range<ModuleDebugStreamRef::LinesAndChecksumsIterator> -ModuleDebugStreamRef::linesAndChecksums() const { - return make_range(LinesAndChecksums.begin(), LinesAndChecksums.end()); +llvm::iterator_range<ModuleDebugStreamRef::DebugSubsectionIterator> +ModuleDebugStreamRef::subsections() const { + return make_range(Subsections.begin(), Subsections.end()); } -bool ModuleDebugStreamRef::hasLineInfo() const { +bool ModuleDebugStreamRef::hasDebugSubsections() const { return C13LinesSubstream.getLength() > 0; } Error ModuleDebugStreamRef::commit() { return Error::success(); } + +Expected<codeview::DebugChecksumsSubsectionRef> +ModuleDebugStreamRef::findChecksumsSubsection() const { + for (const auto &SS : subsections()) { + if (SS.kind() != DebugSubsectionKind::FileChecksums) + continue; + + codeview::DebugChecksumsSubsectionRef Result; + if (auto EC = Result.initialize(SS.getRecordData())) + return std::move(EC); + return Result; + } + return make_error<RawError>(raw_error_code::no_entry); +} |
