Go to the documentation of this file.
9 #ifndef LLVM_DEBUGINFO_DWARF_DWARFACCELERATORTABLE_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFACCELERATORTABLE_H
106 struct HeaderData HdrData;
107 bool IsValid =
false;
117 const HeaderData *HdrData =
nullptr;
148 unsigned NumData = 0;
173 return A.NumData ==
B.NumData && A.DataOffset ==
B.DataOffset;
336 struct AbbrevMapInfo {
337 static Abbrev getEmptyKey();
338 static Abbrev getTombstoneKey();
339 static unsigned getHashValue(
uint32_t Code) {
342 static unsigned getHashValue(
const Abbrev &Abbr) {
343 return getHashValue(Abbr.Code);
349 return LHS.Code ==
RHS.Code;
366 : StrData(StrData),
Index(
Index), StringOffset(StringOffset),
367 EntryOffset(EntryOffset) {}
499 bool getEntryAtCurrentOffset();
501 bool findInCurrentIndex();
502 void searchFromStartOfCurrentIndex();
533 return A.CurrentIndex ==
B.CurrentIndex && A.DataOffset ==
B.DataOffset;
549 assert(CurrentName <= CurrentIndex->getNameCount());
563 : CurrentIndex(CurrentIndex), CurrentName(CurrentName) {}
579 return A.CurrentIndex ==
B.CurrentIndex && A.CurrentName ==
B.CurrentName;
612 #endif // LLVM_DEBUGINFO_DWARF_DWARFACCELERATORTABLE_H
ValueIterator()=default
End marker.
This is an optimization pass for GlobalISel generic memory operations.
virtual Optional< dwarf::Tag > getTag() const =0
Returns the Tag of the Debug Info Entry associated with this Accelerator Entry or None if the Tag is ...
const char * getString() const
Return the string referenced by this name table entry or nullptr if the string offset is not valid.
void dump(raw_ostream &OS) const override
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
virtual void dump(raw_ostream &OS) const =0
AppleAcceleratorTable(const DWARFDataExtractor &AccelSection, DataExtractor StringSection)
Optional< dwarf::Tag > getTag() const override
Returns the Tag of the Debug Info Entry associated with this Accelerator Entry or None if the Tag is ...
uint64_t getNextUnitOffset() const
const_iterator begin() const
SmallVector< DWARFFormValue, 3 > Values
uint32_t getLocalTUCount() const
A single entry in the Name Table (DWARF v5 sect.
uint32_t getBucketCount() const
ValueIterator & operator++()
friend bool operator!=(const NameIterator &A, const NameIterator &B)
Tagged union holding either a T or a Error.
This class holds an abstract representation of an Accelerator Table, consisting of a sequence of buck...
Abbreviation describing the encoding of Name Index entries.
Optional< dwarf::Tag > getTag() const override
Returns the Tag of the Debug Info Entry associated with this Accelerator Entry or None if the Tag is ...
bool isEqual(const GCNRPTracker::LiveRegSet &S1, const GCNRPTracker::LiveRegSet &S2)
Index attribute and its encoding.
Optional< uint64_t > getCUIndex() const
Returns the Index into the Compilation Unit list of the owning Name Index or None if this Accelerator...
uint32_t getBucketArrayEntry(uint32_t Bucket) const
Reads an entry in the Bucket Array for the given Bucket.
void operator=(const DWARFAcceleratorTable &)=delete
NameIterator begin() const
An information struct used to provide DenseMap with the various necessary components for a given valu...
uint32_t getHeaderDataLength()
dwarf::Tag tag() const
.debug_names-specific getter, which always succeeds (DWARF v5 index entries always have a tag).
NameTableEntry operator*() const
Represents a single accelerator table within the DWARF v5 .debug_names section.
ValueIterator()=default
End marker.
Expected< Entry > getEntry(uint64_t *Offset) const
friend bool operator==(const AttributeEncoding &LHS, const AttributeEncoding &RHS)
uint32_t getHashArrayEntry(uint32_t Index) const
Reads an entry in the Hash Array for the given Index.
iterator_range< ValueIterator > equal_range(StringRef Key) const
Look up all entries in this Name Index matching Key.
uint32_t getForeignTUCount() const
std::input_iterator_tag iterator_category
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
dwarf::Tag Tag
Dwarf Tag of the described entity.
This class implements an extremely fast bulk output stream that can only output to a stream.
DWARFDebugNames(const DWARFDataExtractor &AccelSection, DataExtractor StringSection)
DWARFAcceleratorTable(const DWARFDataExtractor &AccelSection, DataExtractor StringSection)
virtual Error extract()=0
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
Entry & operator=(const Entry &)=default
ArrayRef< std::pair< HeaderData::AtomType, HeaderData::Form > > getAtomsDesc()
Return the Atom description, which can be used to interpret the raw values of the Accelerator Entries...
DWARFDataExtractor AccelSection
uint32_t getIndex() const
Return the index of this name in the parent Name Index.
std::pair< uint64_t, dwarf::Tag > readAtoms(uint64_t *HashDataOffset)
Return information related to the DWARF DIE we're looking for when performing a lookup by name.
Implements a dense probed hash-table based set.
ValueIterator operator++(int)
const NameIndex * getCUNameIndex(uint64_t CUOffset)
Return the Name Index covering the compile unit at CUOffset, or nullptr if there is no Name Index cov...
NameIterator(const NameIndex *CurrentIndex, uint32_t CurrentName)
Creates an iterator whose initial position is name CurrentName in CurrentIndex.
uint64_t getForeignTUSignature(uint32_t TU) const
Reads signature of foreign type unit TU. TU is 0-based.
uint8_t getUnitLengthFieldByteSize(DwarfFormat Format)
Get the byte size of the unit length field depending on the DWARF format.
typename SuperClass::const_iterator const_iterator
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Error returned by NameIndex::getEntry to report it has reached the end of the entry list.
uint64_t getLocalTUOffset(uint32_t TU) const
Reads offset of local type unit TU, TU is 0-based.
Base class for user error types.
iterator_range< ValueIterator > equal_range(StringRef Key) const
Look up all entries in the accelerator table matching Key.
ArrayRef< DWARFFormValue > getValues() const
Returns the raw values of fields in the Accelerator Entry.
void log(raw_ostream &OS) const override
Print an error message to an output stream.
DataExtractor StringSection
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef - Represent a constant reference to a string, i.e.
friend bool operator!=(const ValueIterator &A, const ValueIterator &B)
static const char Magic[]
const Entry & operator*() const
This implements the Apple accelerator table format, a precursor of the DWARF 5 accelerator table form...
void dump(ScopedPrinter &W) const
virtual Optional< uint64_t > getCUOffset() const =0
Returns the Offset of the Compilation Unit associated with this Accelerator Entry or None if the Comp...
Optional< uint64_t > getDIEUnitOffset() const
Returns the Offset of the DIE within the containing CU or TU.
An abstract class representing a single entry in the accelerator tables.
std::ptrdiff_t difference_type
DWARF v5-specific implementation of an Accelerator Entry.
uint64_t getStringOffset() const
Returns the offset of the name of the described entities.
iterator_range< ValueIterator > equal_range(StringRef Key) const
Look up all entries in the accelerator table matching Key.
uint64_t getEntryOffset() const
Returns the offset of the first Entry in the list.
const_iterator end() const
uint64_t getUnitOffset() const
Lightweight error class with error context and mandatory checking.
void dump(raw_ostream &OS) const override
NameIterator operator++(int)
const Abbrev & getAbbrev() const
Return the Abbreviation that can be used to interpret the raw values of this Accelerator Entry.
friend bool operator==(const ValueIterator &A, const ValueIterator &B)
uint32_t Code
Abbreviation code.
friend bool operator==(const NameIterator &A, const NameIterator &B)
ValueIterator operator++(int)
Apple-specific implementation of an Accelerator Entry.
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
NameIndex(const DWARFDebugNames &Section, uint64_t Base)
Optional< uint64_t > getCUOffset() const override
Returns the Offset of the Compilation Unit associated with this Accelerator Entry or None if the Comp...
Abbrev(uint32_t Code, dwarf::Tag Tag, std::vector< AttributeEncoding > Attributes)
NameTableEntry(const DataExtractor &StrData, uint32_t Index, uint64_t StringOffset, uint64_t EntryOffset)
uint32_t getNameCount() const
SmallVector< NameIndex, 0 >::const_iterator const_iterator
NameTableEntry getNameTableEntry(uint32_t Index) const
Reads an entry in the Name Table for the given Index.
Optional< DWARFFormValue > lookup(dwarf::Index Index) const
Returns the value of the Index Attribute in this Accelerator Entry, if the Entry contains such Attrib...
friend bool operator==(const ValueIterator &A, const ValueIterator &B)
void dump(ScopedPrinter &W) const
A range adaptor for a pair of iterators.
Optional< DWARFFormValue > lookup(HeaderData::AtomType Atom) const
Returns the value of the Atom in this Accelerator Entry, if the Entry contains such Atom.
Optional< uint64_t > getCUOffset() const override
Returns the Offset of the Compilation Unit associated with this Accelerator Entry or None if the Comp...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
ValueIterator & operator++()
std::vector< AttributeEncoding > Attributes
List of index attributes.
virtual ~DWARFAcceleratorTable()
.debug_names section consists of one or more units.
const DenseSet< Abbrev, AbbrevMapInfo > & getAbbrevs() const
friend bool operator!=(const ValueIterator &A, const ValueIterator &B)
void dump(ScopedPrinter &W) const
uint32_t getCUCount() const
uint64_t getCUOffset(uint32_t CU) const
Reads offset of compilation unit CU. CU is 0-based.
Optional< uint64_t > getDIESectionOffset() const
Returns the Section Offset of the Debug Info Entry associated with this Accelerator Entry or None if ...
The accelerator tables are designed to allow efficient random access (using a symbol name as a key) i...
LLVM Value Representation.
std::input_iterator_tag iterator_category
std::input_iterator_tag iterator_category
NameIterator & operator++()
constexpr AttributeEncoding(dwarf::Index Index, dwarf::Form Form)
const Entry & operator*() const
std::ptrdiff_t difference_type