24 using namespace llvm::codeview;
25 using namespace llvm::msf;
26 using namespace llvm::pdb;
28 ModuleDebugStreamRef::ModuleDebugStreamRef(
30 std::unique_ptr<MappedBlockStream> Stream)
31 : Mod(Module), Stream(std::move(Stream)) {}
42 if (C11Size > 0 && C13Size > 0)
44 "Module has both C11 and C13 line info");
63 if (
auto EC = SubsectionsReader.
readArray(Subsections,
70 if (
auto EC = Reader.
readSubstream(GlobalRefsSubstream, GlobalRefsSize))
73 return make_error<RawError>(raw_error_code::corrupt_file,
74 "Unexpected bytes in module stream.");
80 return SymbolsSubstream;
84 return C11LinesSubstream;
88 return C13LinesSubstream;
92 return GlobalRefsSubstream;
106 return !C13LinesSubstream.
empty();
115 if (
SS.kind() != DebugSubsectionKind::FileChecksums)
119 return std::move(
EC);
Error readSubstream(BinarySubstreamRef &Stream, uint32_t Size)
Read Length bytes from the underlying stream into Stream.
Error readInteger(T &Dest)
Read an integer of the specified endianness into Dest and update the stream's offset.
A Module instance is used to store all the information related to an LLVM module. ...
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
bool hasDebugSubsections() const
iterator_range< codeview::CVSymbolArray::Iterator > symbols(bool *HadError) const
Tagged union holding either a T or a Error.
Error initialize(BinaryStreamReader Reader)
uint32_t bytesRemaining() const
uint32_t getSymbolDebugInfoByteSize() const
BinaryStreamRef StreamData
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
static ErrorSuccess success()
Create a success value.
BinarySubstreamRef getC13LinesSubstream() const
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
uint32_t getC11LineInfoByteSize() const
A range adaptor for a pair of iterators.
iterator_range< DebugSubsectionIterator > subsections() const
BinarySubstreamRef getGlobalRefsSubstream() const
Lightweight error class with error context and mandatory checking.
Iterator begin(bool *HadError=nullptr) const
Provides read only access to a subclass of BinaryStream.
Expected< codeview::DebugChecksumsSubsectionRef > findChecksumsSubsection() const
BinarySubstreamRef getSymbolsSubstream() const
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Get a reference to a NumElements element array of objects of type T from the underlying stream as if ...
uint32_t getC13LineInfoByteSize() const
BinarySubstreamRef getC11LinesSubstream() const