30 ModuleDebugStreamRef::ModuleDebugStreamRef(
32 std::unique_ptr<MappedBlockStream> Stream)
33 :
Mod(Module), Stream(
std::move(Stream)) {}
41 if (
Error E = reloadSerialize(Reader))
46 "Unexpected bytes in module stream.");
51 uint32_t SymbolSize =
Mod.getSymbolDebugInfoByteSize();
55 if (C11Size > 0 && C13Size > 0)
57 "Module has both C11 and C13 line info");
77 if (
auto EC = SubsectionsReader.
readArray(Subsections,
84 if (
auto EC = Reader.
readSubstream(GlobalRefsSubstream, GlobalRefsSize))
95 return SymbolsSubstream;
99 return C11LinesSubstream;
103 return C13LinesSubstream;
107 return GlobalRefsSubstream;
112 return make_range(SymbolArray.begin(HadError), SymbolArray.end());
116 auto Iter = SymbolArray.at(Offset);
117 assert(Iter != SymbolArray.end());
123 return make_range(Subsections.begin(), Subsections.end());
127 return !C13LinesSubstream.empty();
135 for (
const auto &
SS : subsections()) {
136 if (
SS.kind() != DebugSubsectionKind::FileChecksums)
140 return std::move(
EC);
const codeview::CVSymbolArray getSymbolArrayForScope(uint32_t ScopeBegin) const
This class represents lattice values for constants.
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
codeview::CVSymbol readSymbolAtOffset(uint32_t Offset) const
Tagged union holding either a T or a Error.
const uint16_t kInvalidStreamIndex
Error initialize(BinaryStreamReader Reader)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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.
void setOffset(uint32_t Off)
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.
Error readSubstream(BinarySubstreamRef &Ref, uint32_t Length)
Read Length bytes from the underlying stream into Ref.
CVSymbolArray limitSymbolArrayToScope(const CVSymbolArray &Symbols, uint32_t ScopeBegin)
BinarySubstreamRef getGlobalRefsSubstream() const
uint32_t bytesRemaining() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
Provides read only access to a subclass of BinaryStream.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
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 ...