LLVM 20.0.0git
Public Member Functions | Friends | List of all members
llvm::DWARFDebugNames::Entry Class Referencefinal

DWARF v5-specific implementation of an Accelerator Entry. More...

#include "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h"

Inheritance diagram for llvm::DWARFDebugNames::Entry:
Inheritance graph
[legend]

Public Member Functions

const NameIndexgetNameIndex () const
 
std::optional< uint64_tgetCUOffset () const override
 Returns the Offset of the Compilation Unit associated with this Accelerator Entry or std::nullopt if the Compilation Unit offset is not recorded in this Accelerator Entry.
 
std::optional< uint64_tgetLocalTUOffset () const override
 Returns the Offset of the Type Unit associated with this Accelerator Entry or std::nullopt if the Type Unit offset is not recorded in this Accelerator Entry.
 
std::optional< uint64_tgetForeignTUTypeSignature () const override
 Returns the type signature of the Type Unit associated with this Accelerator Entry or std::nullopt if the Type Unit offset is not recorded in this Accelerator Entry.
 
std::optional< dwarf::TaggetTag () const override
 Returns the Tag of the Debug Info Entry associated with this Accelerator Entry or std::nullopt if the Tag is not recorded in this Accelerator Entry.
 
std::optional< uint64_tgetRelatedCUOffset () const
 
std::optional< uint64_tgetCUIndex () const
 Returns the Index into the Compilation Unit list of the owning Name Index or std::nullopt if this Accelerator Entry does not have an associated Compilation Unit.
 
std::optional< uint64_tgetRelatedCUIndex () const
 Similar functionality to getCUIndex() but without the DW_IDX_type_unit restriction.
 
std::optional< uint64_tgetLocalTUIndex () const
 Returns the Index into the Local Type Unit list of the owning Name Index or std::nullopt if this Accelerator Entry does not have an associated Type Unit.
 
dwarf::Tag tag () const
 .debug_names-specific getter, which always succeeds (DWARF v5 index entries always have a tag).
 
std::optional< uint64_tgetDIEUnitOffset () const
 Returns the Offset of the DIE within the containing CU or TU.
 
bool hasParentInformation () const
 Returns true if this Entry has information about its parent DIE (i.e.
 
Expected< std::optional< DWARFDebugNames::Entry > > getParentDIEEntry () const
 Returns the Entry corresponding to the parent of the DIE represented by this Entry.
 
const AbbrevgetAbbrev () const
 Return the Abbreviation that can be used to interpret the raw values of this Accelerator Entry.
 
std::optional< DWARFFormValuelookup (dwarf::Index Index) const
 Returns the value of the Index Attribute in this Accelerator Entry, if the Entry contains such Attribute.
 
void dump (ScopedPrinter &W) const
 
void dumpParentIdx (ScopedPrinter &W, const DWARFFormValue &FormValue) const
 
- Public Member Functions inherited from llvm::DWARFAcceleratorTable::Entry
virtual std::optional< uint64_tgetCUOffset () const =0
 Returns the Offset of the Compilation Unit associated with this Accelerator Entry or std::nullopt if the Compilation Unit offset is not recorded in this Accelerator Entry.
 
virtual std::optional< uint64_tgetLocalTUOffset () const
 Returns the Offset of the Type Unit associated with this Accelerator Entry or std::nullopt if the Type Unit offset is not recorded in this Accelerator Entry.
 
virtual std::optional< uint64_tgetForeignTUTypeSignature () const
 Returns the type signature of the Type Unit associated with this Accelerator Entry or std::nullopt if the Type Unit offset is not recorded in this Accelerator Entry.
 
virtual std::optional< dwarf::TaggetTag () const =0
 Returns the Tag of the Debug Info Entry associated with this Accelerator Entry or std::nullopt if the Tag is not recorded in this Accelerator Entry.
 
ArrayRef< DWARFFormValuegetValues () const
 Returns the raw values of fields in the Accelerator Entry.
 

Friends

class NameIndex
 
class ValueIterator
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::DWARFAcceleratorTable::Entry
 Entry ()=default
 
 Entry (const Entry &)=default
 
 Entry (Entry &&)=default
 
Entryoperator= (const Entry &)=default
 
Entryoperator= (Entry &&)=default
 
 ~Entry ()=default
 
- Protected Attributes inherited from llvm::DWARFAcceleratorTable::Entry
SmallVector< DWARFFormValue, 3 > Values
 

Detailed Description

DWARF v5-specific implementation of an Accelerator Entry.

Definition at line 437 of file DWARFAcceleratorTable.h.

Member Function Documentation

◆ dump()

void DWARFDebugNames::Entry::dump ( ScopedPrinter W) const

◆ dumpParentIdx()

void DWARFDebugNames::Entry::dumpParentIdx ( ScopedPrinter W,
const DWARFFormValue FormValue 
) const

◆ getAbbrev()

const Abbrev & llvm::DWARFDebugNames::Entry::getAbbrev ( ) const
inline

Return the Abbreviation that can be used to interpret the raw values of this Accelerator Entry.

Definition at line 497 of file DWARFAcceleratorTable.h.

◆ getCUIndex()

std::optional< uint64_t > DWARFDebugNames::Entry::getCUIndex ( ) const

Returns the Index into the Compilation Unit list of the owning Name Index or std::nullopt if this Accelerator Entry does not have an associated Compilation Unit.

It is up to the user to verify that the returned Index is valid in the owning NameIndex (or use getCUOffset(), which will handle that check itself). Note that entries in NameIndexes which index just a single Compilation Unit are implicitly associated with that unit, so this function will return 0 even without an explicit DW_IDX_compile_unit attribute, unless there is a DW_IDX_type_unit attribute.

Definition at line 644 of file DWARFAcceleratorTable.cpp.

References lookup().

◆ getCUOffset()

std::optional< uint64_t > DWARFDebugNames::Entry::getCUOffset ( ) const
overridevirtual

Returns the Offset of the Compilation Unit associated with this Accelerator Entry or std::nullopt if the Compilation Unit offset is not recorded in this Accelerator Entry.

Implements llvm::DWARFAcceleratorTable::Entry.

Definition at line 653 of file DWARFAcceleratorTable.cpp.

References llvm::DWARFDebugNames::NameIndex::getCUCount(), and llvm::DWARFDebugNames::NameIndex::getCUOffset().

◆ getDIEUnitOffset()

std::optional< uint64_t > DWARFDebugNames::Entry::getDIEUnitOffset ( ) const

Returns the Offset of the DIE within the containing CU or TU.

Definition at line 627 of file DWARFAcceleratorTable.cpp.

References lookup().

◆ getForeignTUTypeSignature()

std::optional< uint64_t > DWARFDebugNames::Entry::getForeignTUTypeSignature ( ) const
overridevirtual

Returns the type signature of the Type Unit associated with this Accelerator Entry or std::nullopt if the Type Unit offset is not recorded in this Accelerator Entry.

Reimplemented from llvm::DWARFAcceleratorTable::Entry.

Definition at line 675 of file DWARFAcceleratorTable.cpp.

References llvm::DWARFDebugNames::NameIndex::getForeignTUCount(), llvm::DWARFDebugNames::NameIndex::getForeignTUSignature(), and llvm::DWARFDebugNames::NameIndex::getLocalTUCount().

◆ getLocalTUIndex()

std::optional< uint64_t > DWARFDebugNames::Entry::getLocalTUIndex ( ) const

Returns the Index into the Local Type Unit list of the owning Name Index or std::nullopt if this Accelerator Entry does not have an associated Type Unit.

It is up to the user to verify that the returned Index is valid in the owning NameIndex (or use getLocalTUOffset(), which will handle that check itself).

Definition at line 687 of file DWARFAcceleratorTable.cpp.

References lookup().

◆ getLocalTUOffset()

std::optional< uint64_t > DWARFDebugNames::Entry::getLocalTUOffset ( ) const
overridevirtual

Returns the Offset of the Type Unit associated with this Accelerator Entry or std::nullopt if the Type Unit offset is not recorded in this Accelerator Entry.

Reimplemented from llvm::DWARFAcceleratorTable::Entry.

Definition at line 667 of file DWARFAcceleratorTable.cpp.

References llvm::DWARFDebugNames::NameIndex::getLocalTUCount(), and llvm::DWARFDebugNames::NameIndex::getLocalTUOffset().

◆ getNameIndex()

const NameIndex * llvm::DWARFDebugNames::Entry::getNameIndex ( ) const
inline

Definition at line 444 of file DWARFAcceleratorTable.h.

◆ getParentDIEEntry()

Expected< std::optional< DWARFDebugNames::Entry > > DWARFDebugNames::Entry::getParentDIEEntry ( ) const

Returns the Entry corresponding to the parent of the DIE represented by this Entry.

If the parent is not in the table, nullopt is returned. Precondition: hasParentInformation() == true. An error is returned for ill-formed tables.

Definition at line 694 of file DWARFAcceleratorTable.cpp.

References assert(), llvm::DWARFDebugNames::NameIndex::getEntryAtRelativeOffset(), and lookup().

◆ getRelatedCUIndex()

std::optional< uint64_t > DWARFDebugNames::Entry::getRelatedCUIndex ( ) const

Similar functionality to getCUIndex() but without the DW_IDX_type_unit restriction.

This allows us to get the associated a compilation unit index for an entry that is a type unit.

Definition at line 633 of file DWARFAcceleratorTable.cpp.

References llvm::DWARFDebugNames::NameIndex::getCUCount(), and lookup().

◆ getRelatedCUOffset()

std::optional< uint64_t > DWARFDebugNames::Entry::getRelatedCUOffset ( ) const

◆ getTag()

std::optional< dwarf::Tag > llvm::DWARFDebugNames::Entry::getTag ( ) const
inlineoverridevirtual

Returns the Tag of the Debug Info Entry associated with this Accelerator Entry or std::nullopt if the Tag is not recorded in this Accelerator Entry.

Implements llvm::DWARFAcceleratorTable::Entry.

Definition at line 448 of file DWARFAcceleratorTable.h.

References tag().

◆ hasParentInformation()

bool DWARFDebugNames::Entry::hasParentInformation ( ) const

Returns true if this Entry has information about its parent DIE (i.e.

if it has an IDX_parent attribute)

Definition at line 623 of file DWARFAcceleratorTable.cpp.

References lookup().

◆ lookup()

std::optional< DWARFFormValue > DWARFDebugNames::Entry::lookup ( dwarf::Index  Index) const

Returns the value of the Index Attribute in this Accelerator Entry, if the Entry contains such Attribute.

Definition at line 614 of file DWARFAcceleratorTable.cpp.

References assert(), llvm::DWARFDebugNames::Abbrev::Attributes, and llvm::zip_first().

◆ tag()

dwarf::Tag llvm::DWARFDebugNames::Entry::tag ( ) const
inline

.debug_names-specific getter, which always succeeds (DWARF v5 index entries always have a tag).

Definition at line 480 of file DWARFAcceleratorTable.h.

References llvm::DWARFDebugNames::Abbrev::Tag.

Referenced by getTag().

Friends And Related Function Documentation

◆ NameIndex

friend class NameIndex
friend

Definition at line 506 of file DWARFAcceleratorTable.h.

◆ ValueIterator

friend class ValueIterator
friend

Definition at line 507 of file DWARFAcceleratorTable.h.


The documentation for this class was generated from the following files: