mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305093 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user