summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-06-09 17:54:36 +0000
committerZachary Turner <zturner@google.com>2017-06-09 17:54:36 +0000
commit7e62cd17d6813d66e46e7177574be81c665d8eab (patch)
treebdab66465650daaa10cf21e6c08222886c2c36c3 /llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp
parentd9de6389fc705fd662b692c6fd3de640b3dc559e (diff)
downloadbcm5719-llvm-7e62cd17d6813d66e46e7177574be81c665d8eab.tar.gz
bcm5719-llvm-7e62cd17d6813d66e46e7177574be81c665d8eab.zip
Allow VarStreamArray to use stateful extractors.
Previously extractors tried to be stateless with any additional context information needed in order to parse items being passed in via the extraction method. This led to quite cumbersome implementation challenges and awkwardness of use. This patch brings back support for stateful extractors, making the implementation and usage simpler. llvm-svn: 305093
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp')
-rw-r--r--llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp b/llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp
index 520a0ee4454..e7719d05dbd 100644
--- a/llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp
+++ b/llvm/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp
@@ -17,9 +17,8 @@
using namespace llvm;
using namespace llvm::codeview;
-Error VarStreamArrayExtractor<InlineeSourceLine>::extract(
- BinaryStreamRef Stream, uint32_t &Len, InlineeSourceLine &Item,
- bool HasExtraFiles) {
+Error VarStreamArrayExtractor<InlineeSourceLine>::
+operator()(BinaryStreamRef Stream, uint32_t &Len, InlineeSourceLine &Item) {
BinaryStreamReader Reader(Stream);
if (auto EC = Reader.readObject(Item.Header))
@@ -44,8 +43,8 @@ Error DebugInlineeLinesSubsectionRef::initialize(BinaryStreamReader Reader) {
if (auto EC = Reader.readEnum(Signature))
return EC;
- if (auto EC =
- Reader.readArray(Lines, Reader.bytesRemaining(), hasExtraFiles()))
+ Lines.getExtractor().HasExtraFiles = hasExtraFiles();
+ if (auto EC = Reader.readArray(Lines, Reader.bytesRemaining()))
return EC;
assert(Reader.bytesRemaining() == 0);
OpenPOWER on IntegriCloud