diff options
author | Zachary Turner <zturner@google.com> | 2017-04-27 16:12:16 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-04-27 16:12:16 +0000 |
commit | c37cb0c6a5c266f102c130bfe1daaa25329cb997 (patch) | |
tree | 48cd2b14c7b818b9b1a6eec14ae4518ee2dc195d /llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp | |
parent | e5094474187a9b748589aa709c3e1e172d42e87f (diff) | |
download | bcm5719-llvm-c37cb0c6a5c266f102c130bfe1daaa25329cb997.tar.gz bcm5719-llvm-c37cb0c6a5c266f102c130bfe1daaa25329cb997.zip |
[CodeView] Isolate Debug Info Fragments into standalone classes.
Previously parsing of these were all grouped together into a
single master class that could parse any type of debug info
fragment.
With writing forthcoming, the complexity of each individual
fragment is enough to warrant them having their own classes so
that reading and writing of each fragment type can be grouped
together, but isolated from the code for reading and writing
other fragment types.
In doing so, I found a place where parsing code was duplicated
for the FileChecksums fragment, across llvm-readobj and the
CodeView library, and one of the implementations had a bug.
Now that the codepaths are merged, the bug is resolved.
Differential Revision: https://reviews.llvm.org/D32547
llvm-svn: 301557
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp b/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp index 8caa4b85772..56e415a3d54 100644 --- a/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp @@ -21,6 +21,7 @@ #include <cstdint> using namespace llvm; +using namespace llvm::codeview; using namespace llvm::msf; using namespace llvm::pdb; @@ -54,7 +55,8 @@ Error ModuleDebugStream::reload() { return EC; BinaryStreamReader LineReader(C13LinesSubstream); - if (auto EC = LineReader.readArray(LineInfo, LineReader.bytesRemaining())) + if (auto EC = + LineReader.readArray(LinesAndChecksums, LineReader.bytesRemaining())) return EC; uint32_t GlobalRefsSize; @@ -77,13 +79,13 @@ ModuleDebugStream::symbols(bool *HadError) const { return make_range(SymbolsSubstream.begin(HadError), SymbolsSubstream.end()); } -iterator_range<codeview::ModuleDebugFragmentArray::Iterator> -ModuleDebugStream::lines(bool *HadError) const { - return make_range(LineInfo.begin(HadError), LineInfo.end()); +llvm::iterator_range<ModuleDebugStream::LinesAndChecksumsIterator> +ModuleDebugStream::linesAndChecksums() const { + return make_range(LinesAndChecksums.begin(), LinesAndChecksums.end()); } bool ModuleDebugStream::hasLineInfo() const { - return C13LinesSubstream.getLength() > 0 || LinesSubstream.getLength() > 0; + return C13LinesSubstream.getLength() > 0; } Error ModuleDebugStream::commit() { return Error::success(); } |