From 1de49c9ffde764550981d5c65eccfe887aa38f08 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 27 May 2016 18:47:20 +0000 Subject: Resubmit "[pdb] Allow zero-copy read support for symbol streams."" Due to differences in template instantiation rules, it is not portable to static_assert(false) inside of an invalid specialization of a template. Instead I just =delete the method so that it can't be used, and leave a comment that it must be explicitly specialized. llvm-svn: 271027 --- llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp') diff --git a/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp index 38d3f2f23e3..404208a6487 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp @@ -9,6 +9,7 @@ #include "llvm/DebugInfo/PDB/Raw/ModStream.h" +#include "llvm/DebugInfo/CodeView/RecordIterator.h" #include "llvm/DebugInfo/CodeView/StreamReader.h" #include "llvm/DebugInfo/PDB/Raw/ModInfo.h" #include "llvm/DebugInfo/PDB/Raw/RawError.h" @@ -32,8 +33,14 @@ Error ModStream::reload() { return llvm::make_error(raw_error_code::corrupt_file, "Module has both C11 and C13 line info"); - if (auto EC = SymbolsSubstream.load(Reader, SymbolSize)) + codeview::StreamRef S; + + uint32_t SymbolSubstreamSig = 0; + if (auto EC = Reader.readInteger(SymbolSubstreamSig)) + return EC; + if (auto EC = Reader.readArray(SymbolsSubstream, SymbolSize - 4)) return EC; + if (auto EC = Reader.readStreamRef(LinesSubstream, C11Size)) return EC; if (auto EC = Reader.readStreamRef(C13LinesSubstream, C13Size)) @@ -51,6 +58,6 @@ Error ModStream::reload() { return Error::success(); } -iterator_range ModStream::symbols() const { - return codeview::makeSymbolRange(SymbolsSubstream.data().slice(4), nullptr); +iterator_range ModStream::symbols() const { + return llvm::make_range(SymbolsSubstream.begin(), SymbolsSubstream.end()); } -- cgit v1.2.3