LLVM 19.0.0git
Classes | Public Types | Public Member Functions | List of all members
llvm::DWARFAbbreviationDeclaration Class Reference

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

Classes

struct  AttributeSpec
 

Public Types

enum class  ExtractState { Complete , MoreItems }
 
using AttributeSpecVector = SmallVector< AttributeSpec, 8 >
 
using attr_iterator_range = iterator_range< AttributeSpecVector::const_iterator >
 

Public Member Functions

 DWARFAbbreviationDeclaration ()
 
uint32_t getCode () const
 
uint8_t getCodeByteSize () const
 
dwarf::Tag getTag () const
 
bool hasChildren () const
 
attr_iterator_range attributes () const
 
dwarf::Form getFormByIndex (uint32_t idx) const
 
size_t getNumAttributes () const
 
dwarf::Attribute getAttrByIndex (uint32_t idx) const
 
bool getAttrIsImplicitConstByIndex (uint32_t idx) const
 
int64_t getAttrImplicitConstValueByIndex (uint32_t idx) const
 
std::optional< uint32_tfindAttributeIndex (dwarf::Attribute attr) const
 Get the index of the specified attribute.
 
std::optional< DWARFFormValuegetAttributeValue (const uint64_t DIEOffset, const dwarf::Attribute Attr, const DWARFUnit &U) const
 Extract a DWARF form value from a DIE specified by DIE offset.
 
uint64_t getAttributeOffsetFromIndex (uint32_t AttrIndex, uint64_t DIEOffset, const DWARFUnit &U) const
 Compute an offset from a DIE specified by DIE offset and attribute index.
 
std::optional< DWARFFormValuegetAttributeValueFromOffset (uint32_t AttrIndex, uint64_t Offset, const DWARFUnit &U) const
 Extract a DWARF form value from a DIE speccified by attribute index and its offset.
 
llvm::Expected< ExtractStateextract (DataExtractor Data, uint64_t *OffsetPtr)
 
void dump (raw_ostream &OS) const
 
std::optional< size_t > getFixedAttributesByteSize (const DWARFUnit &U) const
 

Detailed Description

Definition at line 26 of file DWARFAbbreviationDeclaration.h.

Member Typedef Documentation

◆ attr_iterator_range

Definition at line 101 of file DWARFAbbreviationDeclaration.h.

◆ AttributeSpecVector

Definition at line 92 of file DWARFAbbreviationDeclaration.h.

Member Enumeration Documentation

◆ ExtractState

Enumerator
Complete 
MoreItems 

Definition at line 28 of file DWARFAbbreviationDeclaration.h.

Constructor & Destructor Documentation

◆ DWARFAbbreviationDeclaration()

DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration ( )

Definition at line 33 of file DWARFAbbreviationDeclaration.cpp.

Member Function Documentation

◆ attributes()

attr_iterator_range llvm::DWARFAbbreviationDeclaration::attributes ( ) const
inline

◆ dump()

void DWARFAbbreviationDeclaration::dump ( raw_ostream OS) const

Definition at line 148 of file DWARFAbbreviationDeclaration.cpp.

References llvm::formatv(), getCode(), getTag(), hasChildren(), and OS.

◆ extract()

llvm::Expected< DWARFAbbreviationDeclaration::ExtractState > DWARFAbbreviationDeclaration::extract ( DataExtractor  Data,
uint64_t OffsetPtr 
)

◆ findAttributeIndex()

std::optional< uint32_t > DWARFAbbreviationDeclaration::findAttributeIndex ( dwarf::Attribute  attr) const

Get the index of the specified attribute.

Searches the this abbreviation declaration for the index of the specified attribute.

Parameters
attrDWARF attribute to search for.
Returns
Optional index of the attribute if found, std::nullopt otherwise.

Definition at line 162 of file DWARFAbbreviationDeclaration.cpp.

References llvm::SmallVectorBase< Size_T >::size().

Referenced by getAttributeValue().

◆ getAttrByIndex()

dwarf::Attribute llvm::DWARFAbbreviationDeclaration::getAttrByIndex ( uint32_t  idx) const
inline

◆ getAttributeOffsetFromIndex()

uint64_t DWARFAbbreviationDeclaration::getAttributeOffsetFromIndex ( uint32_t  AttrIndex,
uint64_t  DIEOffset,
const DWARFUnit U 
) const

Compute an offset from a DIE specified by DIE offset and attribute index.

Parameters
AttrIndexan index of DWARF attribute.
DIEOffsetthe DIE offset that points to the ULEB128 abbreviation code in the .debug_info data.
Uthe DWARFUnit the contains the DIE.
Returns
an offset of the attribute.

Definition at line 170 of file DWARFAbbreviationDeclaration.cpp.

References llvm::Offset, and llvm::DWARFFormValue::skipValue().

Referenced by getAttributeValue().

◆ getAttributeValue()

std::optional< DWARFFormValue > DWARFAbbreviationDeclaration::getAttributeValue ( const uint64_t  DIEOffset,
const dwarf::Attribute  Attr,
const DWARFUnit U 
) const

Extract a DWARF form value from a DIE specified by DIE offset.

Extract an attribute value for a DWARFUnit given the DIE offset and the attribute.

Parameters
DIEOffsetthe DIE offset that points to the ULEB128 abbreviation code in the .debug_info data.
AttrDWARF attribute to search for.
Uthe DWARFUnit the contains the DIE.
Returns
Optional DWARF form value if the attribute was extracted.

Definition at line 207 of file DWARFAbbreviationDeclaration.cpp.

References findAttributeIndex(), getAttributeOffsetFromIndex(), getAttributeValueFromOffset(), and llvm::Offset.

◆ getAttributeValueFromOffset()

std::optional< DWARFFormValue > DWARFAbbreviationDeclaration::getAttributeValueFromOffset ( uint32_t  AttrIndex,
uint64_t  Offset,
const DWARFUnit U 
) const

Extract a DWARF form value from a DIE speccified by attribute index and its offset.

Parameters
AttrIndexan index of DWARF attribute.
Offsetoffset of the attribute.
Uthe DWARFUnit the contains the DIE.
Returns
Optional DWARF form value if the attribute was extracted.

Definition at line 188 of file DWARFAbbreviationDeclaration.cpp.

References assert(), llvm::DWARFFormValue::createFromSValue(), llvm::DWARFFormValue::extractValue(), llvm::Offset, and llvm::SmallVectorBase< Size_T >::size().

Referenced by getAttributeValue().

◆ getAttrImplicitConstValueByIndex()

int64_t llvm::DWARFAbbreviationDeclaration::getAttrImplicitConstValueByIndex ( uint32_t  idx) const
inline

◆ getAttrIsImplicitConstByIndex()

bool llvm::DWARFAbbreviationDeclaration::getAttrIsImplicitConstByIndex ( uint32_t  idx) const
inline

◆ getCode()

uint32_t llvm::DWARFAbbreviationDeclaration::getCode ( ) const
inline

◆ getCodeByteSize()

uint8_t llvm::DWARFAbbreviationDeclaration::getCodeByteSize ( ) const
inline

Definition at line 97 of file DWARFAbbreviationDeclaration.h.

◆ getFixedAttributesByteSize()

std::optional< size_t > DWARFAbbreviationDeclaration::getFixedAttributesByteSize ( const DWARFUnit U) const

◆ getFormByIndex()

dwarf::Form llvm::DWARFAbbreviationDeclaration::getFormByIndex ( uint32_t  idx) const
inline

◆ getNumAttributes()

size_t llvm::DWARFAbbreviationDeclaration::getNumAttributes ( ) const
inline

◆ getTag()

dwarf::Tag llvm::DWARFAbbreviationDeclaration::getTag ( ) const
inline

Definition at line 98 of file DWARFAbbreviationDeclaration.h.

Referenced by dump(), and llvm::DWARFDebugInfoEntry::getTag().

◆ hasChildren()

bool llvm::DWARFAbbreviationDeclaration::hasChildren ( ) const
inline

Definition at line 99 of file DWARFAbbreviationDeclaration.h.

Referenced by dump(), and llvm::DWARFDebugInfoEntry::hasChildren().


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