LLVM 22.0.0git
llvm::dwarf_linker::parallel::DIEAttributeCloner Class Reference

This class creates clones of input DIE attributes. More...

#include "DWARFLinker/Parallel/DIEAttributeCloner.h"

Public Member Functions

 DIEAttributeCloner (DIE *OutDIE, CompileUnit &InUnit, CompileUnit *OutUnit, const DWARFDebugInfoEntry *InputDieEntry, DIEGenerator &Generator, std::optional< int64_t > FuncAddressAdjustment, std::optional< int64_t > VarAddressAdjustment, bool HasLocationExpressionAddress)
 DIEAttributeCloner (DIE *OutDIE, CompileUnit &InUnit, TypeUnit *OutUnit, const DWARFDebugInfoEntry *InputDieEntry, DIEGenerator &Generator, std::optional< int64_t > FuncAddressAdjustment, std::optional< int64_t > VarAddressAdjustment, bool HasLocationExpressionAddress)
void clone ()
 Clone attributes of input DIE.
unsigned finalizeAbbreviations (bool HasChildrenToClone)
 Create abbreviations for the output DIE after all attributes are cloned.
unsigned getOutOffset ()

Public Attributes

AttributesInfo AttrInfo
 Cannot be used concurrently.

Protected Member Functions

 DIEAttributeCloner (DIE *OutDIE, CompileUnit &InUnit, CompileUnit::OutputUnitVariantPtr OutUnit, const DWARFDebugInfoEntry *InputDieEntry, DIEGenerator &Generator, std::optional< int64_t > FuncAddressAdjustment, std::optional< int64_t > VarAddressAdjustment, bool HasLocationExpressionAddress)
size_t cloneStringAttr (const DWARFFormValue &Val, const DWARFAbbreviationDeclaration::AttributeSpec &AttrSpec)
 Clone string attribute.
size_t cloneDieRefAttr (const DWARFFormValue &Val, const DWARFAbbreviationDeclaration::AttributeSpec &AttrSpec)
 Clone attribute referencing another DIE.
size_t cloneScalarAttr (const DWARFFormValue &Val, const DWARFAbbreviationDeclaration::AttributeSpec &AttrSpec)
 Clone scalar attribute.
size_t cloneBlockAttr (const DWARFFormValue &Val, const DWARFAbbreviationDeclaration::AttributeSpec &AttrSpec)
 Clone block or exprloc attribute.
size_t cloneAddressAttr (const DWARFFormValue &Val, const DWARFAbbreviationDeclaration::AttributeSpec &AttrSpec)
 Clone address attribute.
bool shouldSkipAttribute (DWARFAbbreviationDeclaration::AttributeSpec AttrSpec)
 Returns true if attribute should be skipped.

Protected Attributes

DIEOutDIE = nullptr
 Output DIE.
CompileUnitInUnit
 Input compilation unit.
CompileUnit::OutputUnitVariantPtr OutUnit
 Output unit(either "plain" compilation unit, either artificial type unit).
SectionDescriptorDebugInfoOutputSection
 .debug_info section descriptor.
const DWARFDebugInfoEntryInputDieEntry = nullptr
 Input DIE entry.
uint32_t InputDIEIdx = 0
 Input DIE index.
DIEGeneratorGenerator
 Output DIE generator.
std::optional< int64_t > FuncAddressAdjustment
 Relocation adjustment for the function address ranges.
std::optional< int64_t > VarAddressAdjustment
 Relocation adjustment for the variable locations.
bool HasLocationExpressionAddress = false
 Indicates whether InputDieEntry has an location attribute containg address expression.
unsigned AttrOutOffset = 0
 Output offset after all attributes.
OffsetsPtrVector PatchesOffsets
 Patches for the cloned attributes.
bool Use_DW_FORM_strp = false
 This flag forces using DW_FORM_strp for string attributes.

Detailed Description

This class creates clones of input DIE attributes.

It enumerates attributes of input DIE, creates clone for each attribute, adds cloned attribute to the output DIE.

Definition at line 47 of file DIEAttributeCloner.h.

Constructor & Destructor Documentation

◆ DIEAttributeCloner() [1/3]

llvm::dwarf_linker::parallel::DIEAttributeCloner::DIEAttributeCloner ( DIE * OutDIE,
CompileUnit & InUnit,
CompileUnit * OutUnit,
const DWARFDebugInfoEntry * InputDieEntry,
DIEGenerator & Generator,
std::optional< int64_t > FuncAddressAdjustment,
std::optional< int64_t > VarAddressAdjustment,
bool HasLocationExpressionAddress )
inline

◆ DIEAttributeCloner() [2/3]

llvm::dwarf_linker::parallel::DIEAttributeCloner::DIEAttributeCloner ( DIE * OutDIE,
CompileUnit & InUnit,
TypeUnit * OutUnit,
const DWARFDebugInfoEntry * InputDieEntry,
DIEGenerator & Generator,
std::optional< int64_t > FuncAddressAdjustment,
std::optional< int64_t > VarAddressAdjustment,
bool HasLocationExpressionAddress )
inline

◆ DIEAttributeCloner() [3/3]

llvm::dwarf_linker::parallel::DIEAttributeCloner::DIEAttributeCloner ( DIE * OutDIE,
CompileUnit & InUnit,
CompileUnit::OutputUnitVariantPtr OutUnit,
const DWARFDebugInfoEntry * InputDieEntry,
DIEGenerator & Generator,
std::optional< int64_t > FuncAddressAdjustment,
std::optional< int64_t > VarAddressAdjustment,
bool HasLocationExpressionAddress )
inlineprotected

Member Function Documentation

◆ clone()

◆ cloneAddressAttr()

◆ cloneBlockAttr()

◆ cloneDieRefAttr()

◆ cloneScalarAttr()

◆ cloneStringAttr()

◆ finalizeAbbreviations()

unsigned DIEAttributeCloner::finalizeAbbreviations ( bool HasChildrenToClone)

Create abbreviations for the output DIE after all attributes are cloned.

Definition at line 647 of file DIEAttributeCloner.cpp.

References AttrOutOffset, Generator, and PatchesOffsets.

◆ getOutOffset()

unsigned llvm::dwarf_linker::parallel::DIEAttributeCloner::getOutOffset ( )
inline

Definition at line 82 of file DIEAttributeCloner.h.

References AttrOutOffset.

◆ shouldSkipAttribute()

bool DIEAttributeCloner::shouldSkipAttribute ( DWARFAbbreviationDeclaration::AttributeSpec AttrSpec)
protected

Returns true if attribute should be skipped.

Definition at line 138 of file DIEAttributeCloner.cpp.

References llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, FuncAddressAdjustment, HasLocationExpressionAddress, InputDIEIdx, InUnit, and VarAddressAdjustment.

Referenced by clone().

Member Data Documentation

◆ AttrInfo

AttributesInfo llvm::dwarf_linker::parallel::DIEAttributeCloner::AttrInfo

Cannot be used concurrently.

Definition at line 80 of file DIEAttributeCloner.h.

Referenced by clone(), cloneAddressAttr(), cloneBlockAttr(), cloneScalarAttr(), and cloneStringAttr().

◆ AttrOutOffset

unsigned llvm::dwarf_linker::parallel::DIEAttributeCloner::AttrOutOffset = 0
protected

Output offset after all attributes.

Definition at line 173 of file DIEAttributeCloner.h.

Referenced by clone(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), finalizeAbbreviations(), and getOutOffset().

◆ DebugInfoOutputSection

SectionDescriptor& llvm::dwarf_linker::parallel::DIEAttributeCloner::DebugInfoOutputSection
protected

.debug_info section descriptor.

Definition at line 151 of file DIEAttributeCloner.h.

Referenced by clone(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), and DIEAttributeCloner().

◆ FuncAddressAdjustment

std::optional<int64_t> llvm::dwarf_linker::parallel::DIEAttributeCloner::FuncAddressAdjustment
protected

Relocation adjustment for the function address ranges.

Definition at line 163 of file DIEAttributeCloner.h.

Referenced by cloneAddressAttr(), cloneScalarAttr(), DIEAttributeCloner(), DIEAttributeCloner(), DIEAttributeCloner(), and shouldSkipAttribute().

◆ Generator

DIEGenerator& llvm::dwarf_linker::parallel::DIEAttributeCloner::Generator
protected

◆ HasLocationExpressionAddress

bool llvm::dwarf_linker::parallel::DIEAttributeCloner::HasLocationExpressionAddress = false
protected

Indicates whether InputDieEntry has an location attribute containg address expression.

Definition at line 170 of file DIEAttributeCloner.h.

Referenced by cloneBlockAttr(), DIEAttributeCloner(), DIEAttributeCloner(), DIEAttributeCloner(), and shouldSkipAttribute().

◆ InputDieEntry

const DWARFDebugInfoEntry* llvm::dwarf_linker::parallel::DIEAttributeCloner::InputDieEntry = nullptr
protected

◆ InputDIEIdx

uint32_t llvm::dwarf_linker::parallel::DIEAttributeCloner::InputDIEIdx = 0
protected

◆ InUnit

CompileUnit& llvm::dwarf_linker::parallel::DIEAttributeCloner::InUnit
protected

◆ OutDIE

DIE* llvm::dwarf_linker::parallel::DIEAttributeCloner::OutDIE = nullptr
protected

◆ OutUnit

CompileUnit::OutputUnitVariantPtr llvm::dwarf_linker::parallel::DIEAttributeCloner::OutUnit
protected

Output unit(either "plain" compilation unit, either artificial type unit).

Definition at line 148 of file DIEAttributeCloner.h.

Referenced by clone(), cloneAddressAttr(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), DIEAttributeCloner(), DIEAttributeCloner(), and DIEAttributeCloner().

◆ PatchesOffsets

OffsetsPtrVector llvm::dwarf_linker::parallel::DIEAttributeCloner::PatchesOffsets
protected

Patches for the cloned attributes.

Definition at line 176 of file DIEAttributeCloner.h.

Referenced by clone(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), and finalizeAbbreviations().

◆ Use_DW_FORM_strp

bool llvm::dwarf_linker::parallel::DIEAttributeCloner::Use_DW_FORM_strp = false
protected

This flag forces using DW_FORM_strp for string attributes.

Definition at line 179 of file DIEAttributeCloner.h.

Referenced by cloneStringAttr(), and DIEAttributeCloner().

◆ VarAddressAdjustment

std::optional<int64_t> llvm::dwarf_linker::parallel::DIEAttributeCloner::VarAddressAdjustment
protected

Relocation adjustment for the variable locations.

Definition at line 166 of file DIEAttributeCloner.h.

Referenced by cloneAddressAttr(), cloneBlockAttr(), cloneScalarAttr(), DIEAttributeCloner(), DIEAttributeCloner(), DIEAttributeCloner(), and shouldSkipAttribute().


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