LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
llvm::DWARFUnit Class Referenceabstract

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

Inheritance diagram for llvm::DWARFUnit:
Inheritance graph
[legend]

Public Member Functions

 DWARFUnit (DWARFContext &Context, const DWARFSection &Section, const DWARFUnitHeader &Header, const DWARFDebugAbbrev *DA, const DWARFSection *RS, const DWARFSection *LocSection, StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS, const DWARFSection &LS, bool LE, bool IsDWO, const DWARFUnitVector &UnitVector)
 
virtual ~DWARFUnit ()
 
bool isLittleEndian () const
 
bool isDWOUnit () const
 
DWARFContextgetContext () const
 
const DWARFSectiongetInfoSection () const
 
uint64_t getOffset () const
 
const dwarf::FormParamsgetFormParams () const
 
uint16_t getVersion () const
 
uint8_t getAddressByteSize () const
 
uint8_t getRefAddrByteSize () const
 
uint8_t getDwarfOffsetByteSize () const
 
uint32_t getHeaderSize () const
 Size in bytes of the parsed unit header.
 
uint64_t getLength () const
 
dwarf::DwarfFormat getFormat () const
 
uint8_t getUnitType () const
 
bool isTypeUnit () const
 
uint64_t getAbbrOffset () const
 
uint64_t getNextUnitOffset () const
 
const DWARFSectiongetLineSection () const
 
StringRef getStringSection () const
 
const DWARFSectiongetStringOffsetSection () const
 
void setSkeletonUnit (DWARFUnit *SU)
 
DWARFUnitgetLinkedUnit ()
 
void setAddrOffsetSection (const DWARFSection *AOS, uint64_t Base)
 
std::optional< uint64_tgetAddrOffsetSectionBase () const
 
std::optional< uint64_tgetIndexedAddressOffset (uint64_t Index)
 Returns offset to the indexed address value inside .debug_addr section.
 
void updateAddressDieMap (DWARFDie Die)
 Recursively update address to Die map.
 
void updateVariableDieMap (DWARFDie Die)
 Recursively update address to variable Die map.
 
void setRangesSection (const DWARFSection *RS, uint64_t Base)
 
uint64_t getLocSectionBase () const
 
std::optional< object::SectionedAddressgetAddrOffsetSectionItem (uint32_t Index) const
 
Expected< uint64_tgetStringOffsetSectionItem (uint32_t Index) const
 
DWARFDataExtractor getDebugInfoExtractor () const
 
DataExtractor getStringExtractor () const
 
const DWARFLocationTablegetLocationTable ()
 
Error extractRangeList (uint64_t RangeListOffset, DWARFDebugRangeList &RangeList) const
 Extract the range list referenced by this compile unit from the .debug_ranges section.
 
void clear ()
 
const std::optional< StrOffsetsContributionDescriptor > & getStringOffsetsTableContribution ()
 
uint8_t getDwarfStringOffsetsByteSize () const
 
uint64_t getStringOffsetsBase () const
 
uint64_t getAbbreviationsOffset () const
 
const DWARFAbbreviationDeclarationSetgetAbbreviations () const
 
std::optional< object::SectionedAddressgetBaseAddress ()
 
DWARFDie getUnitDIE (bool ExtractUnitDIEOnly=true)
 
DWARFDie getNonSkeletonUnitDIE (bool ExtractUnitDIEOnly=true, StringRef DWOAlternativeLocation={})
 
const chargetCompilationDir ()
 
std::optional< uint64_tgetDWOId ()
 
void setDWOId (uint64_t NewID)
 
Expected< DWARFAddressRangesVectorfindRnglistFromOffset (uint64_t Offset)
 Return a vector of address ranges resulting from a (possibly encoded) range list starting at a given offset in the appropriate ranges section.
 
Expected< DWARFAddressRangesVectorfindRnglistFromIndex (uint32_t Index)
 Return a vector of address ranges retrieved from an encoded range list whose offset is found via a table lookup given an index (DWARF v5 and later).
 
std::optional< uint64_tgetRnglistOffset (uint32_t Index)
 Return a rangelist's offset based on an index.
 
std::optional< uint64_tgetLoclistOffset (uint32_t Index)
 
Expected< DWARFAddressRangesVectorcollectAddressRanges ()
 
Expected< DWARFLocationExpressionsVectorfindLoclistFromOffset (uint64_t Offset)
 
DWARFDie getSubroutineForAddress (uint64_t Address)
 Returns subprogram DIE with address range encompassing the provided address.
 
DWARFDie getVariableForAddress (uint64_t Address)
 Returns variable DIE for the address provided.
 
void getInlinedChainForAddress (uint64_t Address, SmallVectorImpl< DWARFDie > &InlinedChain)
 getInlinedChainForAddress - fetches inlined chain for a given address.
 
const DWARFUnitVectorgetUnitVector () const
 Return the DWARFUnitVector containing this unit.
 
unsigned getNumDIEs ()
 Returns the number of DIEs in the unit.
 
uint32_t getDIEIndex (const DWARFDie &D) const
 Return the index of a DIE inside the unit's DIE vector.
 
DWARFDie getDIEAtIndex (unsigned Index)
 Return the DIE object at the given index Index.
 
DWARFDie getParent (const DWARFDebugInfoEntry *Die)
 
DWARFDie getSibling (const DWARFDebugInfoEntry *Die)
 
DWARFDie getPreviousSibling (const DWARFDebugInfoEntry *Die)
 
DWARFDie getFirstChild (const DWARFDebugInfoEntry *Die)
 
DWARFDie getLastChild (const DWARFDebugInfoEntry *Die)
 
DWARFDie getDIEForOffset (uint64_t Offset)
 Return the DIE object for a given offset Offset inside the unit's DIE vector.
 
std::optional< uint32_tgetDIEIndexForOffset (uint64_t Offset)
 Return the DIE index for a given offset Offset inside the unit's DIE vector.
 
uint32_t getLineTableOffset () const
 
die_iterator_range dies ()
 
virtual void dump (raw_ostream &OS, DIDumpOptions DumpOpts)=0
 
Error tryExtractDIEsIfNeeded (bool CUDieOnly)
 

Static Public Member Functions

static bool isMatchingUnitTypeAndTag (uint8_t UnitType, dwarf::Tag Tag)
 

Protected Member Functions

uint32_t getDIEIndex (const DWARFDebugInfoEntry *Die) const
 Return the index of a Die entry inside the unit's DIE vector.
 
const DWARFDebugInfoEntrygetDebugInfoEntry (unsigned Index) const
 Return DWARFDebugInfoEntry for the specified index Index.
 
const DWARFDebugInfoEntrygetParentEntry (const DWARFDebugInfoEntry *Die) const
 
const DWARFDebugInfoEntrygetSiblingEntry (const DWARFDebugInfoEntry *Die) const
 
const DWARFDebugInfoEntrygetPreviousSiblingEntry (const DWARFDebugInfoEntry *Die) const
 
const DWARFDebugInfoEntrygetFirstChildEntry (const DWARFDebugInfoEntry *Die) const
 
const DWARFDebugInfoEntrygetLastChildEntry (const DWARFDebugInfoEntry *Die) const
 
const DWARFUnitHeadergetHeader () const
 
Expected< std::optional< StrOffsetsContributionDescriptor > > determineStringOffsetsTableContribution (DWARFDataExtractor &DA)
 Find the unit's contribution to the string offsets table and determine its length and form.
 
Expected< std::optional< StrOffsetsContributionDescriptor > > determineStringOffsetsTableContributionDWO (DWARFDataExtractor &DA)
 Find the unit's contribution to the string offsets table and determine its length and form.
 

Detailed Description

Definition at line 211 of file DWARFUnit.h.

Constructor & Destructor Documentation

◆ DWARFUnit()

DWARFUnit::DWARFUnit ( DWARFContext Context,
const DWARFSection Section,
const DWARFUnitHeader Header,
const DWARFDebugAbbrev DA,
const DWARFSection RS,
const DWARFSection LocSection,
StringRef  SS,
const DWARFSection SOS,
const DWARFSection AOS,
const DWARFSection LS,
bool  LE,
bool  IsDWO,
const DWARFUnitVector UnitVector 
)

Definition at line 194 of file DWARFUnit.cpp.

References clear().

◆ ~DWARFUnit()

DWARFUnit::~DWARFUnit ( )
virtualdefault

Member Function Documentation

◆ clear()

void DWARFUnit::clear ( )

◆ collectAddressRanges()

Expected< DWARFAddressRangesVector > DWARFUnit::collectAddressRanges ( )

◆ determineStringOffsetsTableContribution()

Expected< std::optional< StrOffsetsContributionDescriptor > > DWARFUnit::determineStringOffsetsTableContribution ( DWARFDataExtractor DA)
protected

Find the unit's contribution to the string offsets table and determine its length and form.

The given offset is expected to be derived from the unit DIE's DW_AT_str_offsets_base attribute.

Definition at line 1159 of file DWARFUnit.cpp.

References assert(), llvm::find(), getUnitDIE(), parseDWARFStringOffsetsTableHeader(), and llvm::dwarf::toSectionOffset().

Referenced by tryExtractDIEsIfNeeded().

◆ determineStringOffsetsTableContributionDWO()

Expected< std::optional< StrOffsetsContributionDescriptor > > DWARFUnit::determineStringOffsetsTableContributionDWO ( DWARFDataExtractor DA)
protected

Find the unit's contribution to the string offsets table and determine its length and form.

The given offset is expected to be 0 in a dwo file or, in a dwp file, the start of the unit's contribution to the string offsets table section (as determined by the index table).

Definition at line 1172 of file DWARFUnit.cpp.

References assert(), llvm::CallingConv::C, llvm::DWARFSection::Data, llvm::dwarf::DWARF32, llvm::StringRef::empty(), getVersion(), llvm::Offset, parseDWARFStringOffsetsTableHeader(), and llvm::StringRef::size().

Referenced by tryExtractDIEsIfNeeded().

◆ dies()

die_iterator_range llvm::DWARFUnit::dies ( )
inline

Definition at line 560 of file DWARFUnit.h.

◆ dump()

virtual void llvm::DWARFUnit::dump ( raw_ostream OS,
DIDumpOptions  DumpOpts 
)
pure virtual

◆ extractRangeList()

Error DWARFUnit::extractRangeList ( uint64_t  RangeListOffset,
DWARFDebugRangeList RangeList 
) const

Extract the range list referenced by this compile unit from the .debug_ranges section.

If the extraction is unsuccessful, an error is returned. Successful extraction requires that the compile unit has already been extracted.

Definition at line 377 of file DWARFUnit.cpp.

References assert(), llvm::DWARFDebugRangeList::extract(), getAddressByteSize(), and llvm::DWARFContext::getDWARFObj().

Referenced by findRnglistFromOffset().

◆ findLoclistFromOffset()

Expected< DWARFLocationExpressionsVector > DWARFUnit::findLoclistFromOffset ( uint64_t  Offset)

◆ findRnglistFromIndex()

Expected< DWARFAddressRangesVector > DWARFUnit::findRnglistFromIndex ( uint32_t  Index)

Return a vector of address ranges retrieved from an encoded range list whose offset is found via a table lookup given an index (DWARF v5 and later).

Definition at line 684 of file DWARFUnit.cpp.

References llvm::createStringError(), findRnglistFromOffset(), getRnglistOffset(), llvm::invalid_argument, and llvm::Offset.

Referenced by llvm::DWARFDie::getAddressRanges().

◆ findRnglistFromOffset()

Expected< DWARFAddressRangesVector > DWARFUnit::findRnglistFromOffset ( uint64_t  Offset)

Return a vector of address ranges resulting from a (possibly encoded) range list starting at a given offset in the appropriate ranges section.

Definition at line 667 of file DWARFUnit.cpp.

References extractRangeList(), llvm::DWARFListTableBase< DWARFListType >::findList(), llvm::DWARFDebugRangeList::getAbsoluteRanges(), getBaseAddress(), llvm::DWARFContext::getDWARFObj(), getVersion(), and llvm::Offset.

Referenced by findRnglistFromIndex(), and llvm::DWARFDie::getAddressRanges().

◆ getAbbreviations()

const DWARFAbbreviationDeclarationSet * DWARFUnit::getAbbreviations ( ) const

◆ getAbbreviationsOffset()

uint64_t llvm::DWARFUnit::getAbbreviationsOffset ( ) const
inline

Definition at line 420 of file DWARFUnit.h.

Referenced by getAbbreviations().

◆ getAbbrOffset()

uint64_t llvm::DWARFUnit::getAbbrOffset ( ) const
inline

Definition at line 337 of file DWARFUnit.h.

Referenced by llvm::DWARFCompileUnit::dump(), and llvm::DWARFTypeUnit::dump().

◆ getAddressByteSize()

uint8_t llvm::DWARFUnit::getAddressByteSize ( ) const
inline

◆ getAddrOffsetSectionBase()

std::optional< uint64_t > llvm::DWARFUnit::getAddrOffsetSectionBase ( ) const
inline

Definition at line 356 of file DWARFUnit.h.

Referenced by getIndexedAddressOffset().

◆ getAddrOffsetSectionItem()

std::optional< object::SectionedAddress > DWARFUnit::getAddrOffsetSectionItem ( uint32_t  Index) const

◆ getBaseAddress()

std::optional< object::SectionedAddress > DWARFUnit::getBaseAddress ( )

◆ getCompilationDir()

const char * DWARFUnit::getCompilationDir ( )

◆ getContext()

DWARFContext & llvm::DWARFUnit::getContext ( ) const
inline

◆ getDebugInfoEntry()

const DWARFDebugInfoEntry * llvm::DWARFUnit::getDebugInfoEntry ( unsigned  Index) const
inlineprotected

◆ getDebugInfoExtractor()

DWARFDataExtractor DWARFUnit::getDebugInfoExtractor ( ) const

◆ getDIEAtIndex()

DWARFDie llvm::DWARFUnit::getDIEAtIndex ( unsigned  Index)
inline

◆ getDIEForOffset()

DWARFDie llvm::DWARFUnit::getDIEForOffset ( uint64_t  Offset)
inline

Return the DIE object for a given offset Offset inside the unit's DIE vector.

Definition at line 533 of file DWARFUnit.h.

References getDIEIndexForOffset(), and llvm::Offset.

Referenced by llvm::DWARFContext::dump(), and llvm::DWARFTypeUnit::dump().

◆ getDIEIndex() [1/2]

uint32_t llvm::DWARFUnit::getDIEIndex ( const DWARFDebugInfoEntry Die) const
inlineprotected

Return the index of a Die entry inside the unit's DIE vector.

It is illegal to call this method with a DIE that hasn't be created by this unit. In other word, it's illegal to call this method on a DIE that isn't accessible by following children/sibling links starting from this unit's getUnitDIE().

Definition at line 269 of file DWARFUnit.h.

References assert(), and llvm::First.

Referenced by llvm::dwarf_linker::parallel::CompileUnit::getDIEIndex(), getDIEIndex(), llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo(), llvm::dwarf_linker::parallel::CompileUnit::getDieOutOffset(), llvm::dwarf_linker::parallel::CompileUnit::getDieTypeEntry(), getFirstChildEntry(), llvm::dwarf_linker::classic::CompileUnit::getInfo(), getLastChildEntry(), getPreviousSiblingEntry(), llvm::dwarf_linker::parallel::CompileUnit::setDieTypeEntry(), and llvm::dwarf_linker::classic::DeclContext::setLastSeenDIE().

◆ getDIEIndex() [2/2]

uint32_t llvm::DWARFUnit::getDIEIndex ( const DWARFDie D) const
inline

Return the index of a DIE inside the unit's DIE vector.

It is illegal to call this method with a DIE that hasn't be created by this unit. In other word, it's illegal to call this method on a DIE that isn't accessible by following children/sibling links starting from this unit's getUnitDIE().

Definition at line 516 of file DWARFUnit.h.

References D, and getDIEIndex().

◆ getDIEIndexForOffset()

std::optional< uint32_t > llvm::DWARFUnit::getDIEIndexForOffset ( uint64_t  Offset)
inline

◆ getDwarfOffsetByteSize()

uint8_t llvm::DWARFUnit::getDwarfOffsetByteSize ( ) const
inline

Definition at line 328 of file DWARFUnit.h.

◆ getDwarfStringOffsetsByteSize()

uint8_t llvm::DWARFUnit::getDwarfStringOffsetsByteSize ( ) const
inline

Definition at line 410 of file DWARFUnit.h.

References assert().

Referenced by getStringOffsetSectionItem().

◆ getDWOId()

std::optional< uint64_t > llvm::DWARFUnit::getDWOId ( )
inline

Definition at line 458 of file DWARFUnit.h.

References llvm::DWARFUnitHeader::getDWOId(), and getHeader().

Referenced by llvm::DWARFCompileUnit::dump().

◆ getFirstChild()

DWARFDie DWARFUnit::getFirstChild ( const DWARFDebugInfoEntry Die)

Definition at line 984 of file DWARFUnit.cpp.

References getFirstChildEntry().

Referenced by llvm::DWARFDie::getFirstChild().

◆ getFirstChildEntry()

const DWARFDebugInfoEntry * DWARFUnit::getFirstChildEntry ( const DWARFDebugInfoEntry Die) const
protected

◆ getFormat()

dwarf::DwarfFormat llvm::DWARFUnit::getFormat ( ) const
inline

◆ getFormParams()

const dwarf::FormParams & llvm::DWARFUnit::getFormParams ( ) const
inline

Definition at line 322 of file DWARFUnit.h.

◆ getHeader()

const DWARFUnitHeader & llvm::DWARFUnit::getHeader ( ) const
inlineprotected

◆ getHeaderSize()

uint32_t llvm::DWARFUnit::getHeaderSize ( ) const
inline

Size in bytes of the parsed unit header.

Definition at line 332 of file DWARFUnit.h.

◆ getIndexedAddressOffset()

std::optional< uint64_t > llvm::DWARFUnit::getIndexedAddressOffset ( uint64_t  Index)
inline

Returns offset to the indexed address value inside .debug_addr section.

Definition at line 361 of file DWARFUnit.h.

References getAddressByteSize(), getAddrOffsetSectionBase(), and Index.

◆ getInfoSection()

const DWARFSection & llvm::DWARFUnit::getInfoSection ( ) const
inline

Definition at line 320 of file DWARFUnit.h.

◆ getInlinedChainForAddress()

void DWARFUnit::getInlinedChainForAddress ( uint64_t  Address,
SmallVectorImpl< DWARFDie > &  InlinedChain 
)

getInlinedChainForAddress - fetches inlined chain for a given address.

Returns empty chain if there is no subprogram containing address. The chain is valid as long as parsed compile unit DIEs are not cleared.

Definition at line 872 of file DWARFUnit.cpp.

References llvm::Address, assert(), llvm::SmallVectorBase< Size_T >::empty(), llvm::DWARFDie::getParent(), getSubroutineForAddress(), llvm::DWARFDie::getTag(), llvm::DWARFDie::isSubprogramDIE(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().

◆ getLastChild()

DWARFDie DWARFUnit::getLastChild ( const DWARFDebugInfoEntry Die)

Definition at line 1009 of file DWARFUnit.cpp.

References getLastChildEntry().

Referenced by llvm::DWARFDie::getLastChild().

◆ getLastChildEntry()

const DWARFDebugInfoEntry * DWARFUnit::getLastChildEntry ( const DWARFDebugInfoEntry Die) const
protected

◆ getLength()

uint64_t llvm::DWARFUnit::getLength ( ) const
inline

Definition at line 333 of file DWARFUnit.h.

Referenced by llvm::DWARFCompileUnit::dump(), and llvm::DWARFTypeUnit::dump().

◆ getLineSection()

const DWARFSection & llvm::DWARFUnit::getLineSection ( ) const
inline

Definition at line 339 of file DWARFUnit.h.

◆ getLineTableOffset()

uint32_t llvm::DWARFUnit::getLineTableOffset ( ) const
inline

Definition at line 553 of file DWARFUnit.h.

◆ getLinkedUnit()

DWARFUnit * llvm::DWARFUnit::getLinkedUnit ( )
inline

Definition at line 349 of file DWARFUnit.h.

◆ getLocationTable()

const DWARFLocationTable & llvm::DWARFUnit::getLocationTable ( )
inline

Definition at line 394 of file DWARFUnit.h.

Referenced by findLoclistFromOffset().

◆ getLoclistOffset()

std::optional< uint64_t > DWARFUnit::getLoclistOffset ( uint32_t  Index)

◆ getLocSectionBase()

uint64_t llvm::DWARFUnit::getLocSectionBase ( ) const
inline

Definition at line 380 of file DWARFUnit.h.

◆ getNextUnitOffset()

uint64_t llvm::DWARFUnit::getNextUnitOffset ( ) const
inline

◆ getNonSkeletonUnitDIE()

DWARFDie llvm::DWARFUnit::getNonSkeletonUnitDIE ( bool  ExtractUnitDIEOnly = true,
StringRef  DWOAlternativeLocation = {} 
)
inline

Definition at line 450 of file DWARFUnit.h.

Referenced by llvm::DWARFCompileUnit::dump().

◆ getNumDIEs()

unsigned llvm::DWARFUnit::getNumDIEs ( )
inline

Returns the number of DIEs in the unit.

Parses the unit if necessary.

Definition at line 505 of file DWARFUnit.h.

Referenced by llvm::dwarf_linker::parallel::DIEAttributeCloner::clone(), and llvm::dwarf_linker::classic::CompileUnit::CompileUnit().

◆ getOffset()

uint64_t llvm::DWARFUnit::getOffset ( ) const
inline

◆ getParent()

DWARFDie DWARFUnit::getParent ( const DWARFDebugInfoEntry Die)

◆ getParentEntry()

const DWARFDebugInfoEntry * DWARFUnit::getParentEntry ( const DWARFDebugInfoEntry Die) const
protected

Definition at line 909 of file DWARFUnit.cpp.

References assert(), getDebugInfoEntry(), and llvm::DWARFDebugInfoEntry::getParentIdx().

Referenced by getParent().

◆ getPreviousSibling()

DWARFDie DWARFUnit::getPreviousSibling ( const DWARFDebugInfoEntry Die)

Definition at line 945 of file DWARFUnit.cpp.

References getPreviousSiblingEntry().

Referenced by llvm::DWARFDie::getPreviousSibling().

◆ getPreviousSiblingEntry()

const DWARFDebugInfoEntry * DWARFUnit::getPreviousSiblingEntry ( const DWARFDebugInfoEntry Die) const
protected

Definition at line 953 of file DWARFUnit.cpp.

References assert(), getDIEIndex(), and llvm::DWARFDebugInfoEntry::getParentIdx().

Referenced by getPreviousSibling().

◆ getRefAddrByteSize()

uint8_t llvm::DWARFUnit::getRefAddrByteSize ( ) const
inline

Definition at line 327 of file DWARFUnit.h.

◆ getRnglistOffset()

std::optional< uint64_t > DWARFUnit::getRnglistOffset ( uint32_t  Index)

Return a rangelist's offset based on an index.

The index designates an entry in the rangelist table's offset array and is supplied by DW_FORM_rnglistx.

Definition at line 1208 of file DWARFUnit.cpp.

References llvm::DWARFSection::Data, getAddressByteSize(), llvm::DWARFContext::getDWARFObj(), getFormat(), and llvm::DWARFListTableHeader::getOffsetEntry().

Referenced by llvm::dwarf_linker::parallel::DIEAttributeCloner::cloneScalarAttr(), and findRnglistFromIndex().

◆ getSibling()

DWARFDie DWARFUnit::getSibling ( const DWARFDebugInfoEntry Die)

Definition at line 923 of file DWARFUnit.cpp.

References getSiblingEntry().

Referenced by llvm::DWARFDie::getSibling().

◆ getSiblingEntry()

const DWARFDebugInfoEntry * DWARFUnit::getSiblingEntry ( const DWARFDebugInfoEntry Die) const
protected

◆ getStringExtractor()

DataExtractor llvm::DWARFUnit::getStringExtractor ( ) const
inline

Definition at line 390 of file DWARFUnit.h.

Referenced by llvm::DWARFFormValue::getAsCString().

◆ getStringOffsetsBase()

uint64_t llvm::DWARFUnit::getStringOffsetsBase ( ) const
inline

Definition at line 415 of file DWARFUnit.h.

References assert().

Referenced by getStringOffsetSectionItem().

◆ getStringOffsetSection()

const DWARFSection & llvm::DWARFUnit::getStringOffsetSection ( ) const
inline

Definition at line 341 of file DWARFUnit.h.

◆ getStringOffsetSectionItem()

Expected< uint64_t > DWARFUnit::getStringOffsetSectionItem ( uint32_t  Index) const

◆ getStringOffsetsTableContribution()

const std::optional< StrOffsetsContributionDescriptor > & llvm::DWARFUnit::getStringOffsetsTableContribution ( )
inline

Definition at line 405 of file DWARFUnit.h.

◆ getStringSection()

StringRef llvm::DWARFUnit::getStringSection ( ) const
inline

Definition at line 340 of file DWARFUnit.h.

◆ getSubroutineForAddress()

DWARFDie DWARFUnit::getSubroutineForAddress ( uint64_t  Address)

Returns subprogram DIE with address range encompassing the provided address.

The pointer is alive as long as parsed compile unit DIEs are not cleared.

Definition at line 763 of file DWARFUnit.cpp.

References llvm::Address, getUnitDIE(), and updateAddressDieMap().

Referenced by llvm::DWARFContext::getDIEsForAddress(), and getInlinedChainForAddress().

◆ getUnitDIE()

DWARFDie llvm::DWARFUnit::getUnitDIE ( bool  ExtractUnitDIEOnly = true)
inline

◆ getUnitType()

uint8_t llvm::DWARFUnit::getUnitType ( ) const
inline

Definition at line 335 of file DWARFUnit.h.

Referenced by llvm::DWARFCompileUnit::dump(), and llvm::DWARFTypeUnit::dump().

◆ getUnitVector()

const DWARFUnitVector & llvm::DWARFUnit::getUnitVector ( ) const
inline

Return the DWARFUnitVector containing this unit.

Definition at line 501 of file DWARFUnit.h.

Referenced by llvm::DWARFDie::getAttributeValueAsReferencedDie().

◆ getVariableForAddress()

DWARFDie DWARFUnit::getVariableForAddress ( uint64_t  Address)

Returns variable DIE for the address provided.

The pointer is alive as long as parsed compile unit DIEs are not cleared.

Definition at line 851 of file DWARFUnit.cpp.

References llvm::Address, getUnitDIE(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), and updateVariableDieMap().

◆ getVersion()

uint16_t llvm::DWARFUnit::getVersion ( ) const
inline

◆ isDWOUnit()

bool llvm::DWARFUnit::isDWOUnit ( ) const
inline

◆ isLittleEndian()

bool llvm::DWARFUnit::isLittleEndian ( ) const
inline

◆ isMatchingUnitTypeAndTag()

static bool llvm::DWARFUnit::isMatchingUnitTypeAndTag ( uint8_t  UnitType,
dwarf::Tag  Tag 
)
inlinestatic

Definition at line 424 of file DWARFUnit.h.

References llvm::dwarf::isUnitType(), and llvm::Tag.

◆ isTypeUnit()

bool llvm::DWARFUnit::isTypeUnit ( ) const
inline

Definition at line 336 of file DWARFUnit.h.

◆ setAddrOffsetSection()

void llvm::DWARFUnit::setAddrOffsetSection ( const DWARFSection AOS,
uint64_t  Base 
)
inline

Definition at line 351 of file DWARFUnit.h.

References llvm::sampleprof::Base.

◆ setDWOId()

void llvm::DWARFUnit::setDWOId ( uint64_t  NewID)
inline

Definition at line 462 of file DWARFUnit.h.

◆ setRangesSection()

void llvm::DWARFUnit::setRangesSection ( const DWARFSection RS,
uint64_t  Base 
)
inline

Definition at line 375 of file DWARFUnit.h.

References llvm::sampleprof::Base.

Referenced by tryExtractDIEsIfNeeded().

◆ setSkeletonUnit()

void llvm::DWARFUnit::setSkeletonUnit ( DWARFUnit SU)
inline

Definition at line 345 of file DWARFUnit.h.

◆ tryExtractDIEsIfNeeded()

Error DWARFUnit::tryExtractDIEsIfNeeded ( bool  CUDieOnly)

◆ updateAddressDieMap()

void DWARFUnit::updateAddressDieMap ( DWARFDie  Die)

◆ updateVariableDieMap()

void DWARFUnit::updateVariableDieMap ( DWARFDie  Die)

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