28 ModuleDebugStreamRef::ModuleDebugStreamRef(
30 std::unique_ptr<MappedBlockStream> Stream)
31 :
Mod(Module), Stream(
std::move(Stream)) {}
38 uint32_t SymbolSize =
Mod.getSymbolDebugInfoByteSize();
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;
97 return make_range(SymbolArray.begin(HadError), SymbolArray.end());
102 return make_range(Subsections.begin(), Subsections.end());
106 return !C13LinesSubstream.empty();
114 for (
const auto &SS : subsections()) {
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.
Compute iterated dominance frontiers using a linear time algorithm.
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. ...
Expected< codeview::DebugChecksumsSubsectionRef > findChecksumsSubsection() const
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
BinarySubstreamRef getC13LinesSubstream() const
iterator_range< DebugSubsectionIterator > subsections() const
Tagged union holding either a T or a Error.
Error initialize(BinaryStreamReader Reader)
iterator_range< codeview::CVSymbolArray::Iterator > symbols(bool *HadError) const
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
static ErrorSuccess success()
Create a success value.
bool hasDebugSubsections() const
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
BinarySubstreamRef getC11LinesSubstream() const
BinarySubstreamRef getSymbolsSubstream() const
The access may modify the value stored in memory.
A range adaptor for a pair of iterators.
BinarySubstreamRef getGlobalRefsSubstream() const
uint32_t bytesRemaining() const
Lightweight error class with error context and mandatory checking.
Provides read only access to a subclass of BinaryStream.
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 ...