LLVM 22.0.0git
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

Public Member Functions

LLVM_ABI 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
LLVM_ABI std::optional< uint32_tfindAttributeIndex (dwarf::Attribute attr) const
 Get the index of the specified attribute.
LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI 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_ABI llvm::Expected< ExtractStateextract (DataExtractor Data, uint64_t *OffsetPtr)
LLVM_ABI void dump (raw_ostream &OS) const
LLVM_ABI std::optional< size_t > getFixedAttributesByteSize (const DWARFUnit &U) const

Detailed Description

Definition at line 27 of file DWARFAbbreviationDeclaration.h.

Member Typedef Documentation

◆ attr_iterator_range

◆ AttributeSpecVector

Member Enumeration Documentation

◆ ExtractState

Enumerator
Complete 
MoreItems 

Definition at line 29 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

Definition at line 105 of file DWARFAbbreviationDeclaration.h.

◆ dump()

void DWARFAbbreviationDeclaration::dump ( raw_ostream & OS) const

Definition at line 148 of file DWARFAbbreviationDeclaration.cpp.

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

◆ extract()

◆ 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.

Referenced by getAttributeValue().

◆ getAttrByIndex()

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

Definition at line 118 of file DWARFAbbreviationDeclaration.h.

References assert().

◆ 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(), and llvm::Offset.

Referenced by getAttributeValue().

◆ getAttrImplicitConstValueByIndex()

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

Definition at line 128 of file DWARFAbbreviationDeclaration.h.

References assert().

◆ getAttrIsImplicitConstByIndex()

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

Definition at line 123 of file DWARFAbbreviationDeclaration.h.

References assert().

◆ getCode()

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

◆ getCodeByteSize()

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

Definition at line 98 of file DWARFAbbreviationDeclaration.h.

◆ getFixedAttributesByteSize()

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

Definition at line 246 of file DWARFAbbreviationDeclaration.cpp.

◆ getFormByIndex()

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

Definition at line 109 of file DWARFAbbreviationDeclaration.h.

References assert().

◆ getNumAttributes()

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

Definition at line 114 of file DWARFAbbreviationDeclaration.h.

◆ getTag()

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

Definition at line 99 of file DWARFAbbreviationDeclaration.h.

Referenced by dump().

◆ hasChildren()

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

Definition at line 100 of file DWARFAbbreviationDeclaration.h.

Referenced by dump().


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