|
LLVM 24.0.0git
|
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 Attributes | |
| DIE * | OutDIE = nullptr |
| Output DIE. | |
| CompileUnit & | InUnit |
| Input compilation unit. | |
| CompileUnit::OutputUnitVariantPtr | OutUnit |
| Output unit(either "plain" compilation unit, either artificial type unit). | |
| SectionDescriptor & | DebugInfoOutputSection |
| .debug_info section descriptor. | |
| const DWARFDebugInfoEntry * | InputDieEntry = nullptr |
| Input DIE entry. | |
| uint32_t | InputDIEIdx = 0 |
| Input DIE index. | |
| DIEGenerator & | Generator |
| 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. | |
| RelocationFixups::AttributeSource | Source |
| bool | SaveRelocs = false |
| bool | Use_DW_FORM_strp = false |
| This flag forces using DW_FORM_strp for string attributes. | |
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 50 of file DIEAttributeCloner.h.
|
inline |
Definition at line 52 of file DIEAttributeCloner.h.
References DIEAttributeCloner(), FuncAddressAdjustment, Generator, HasLocationExpressionAddress, InputDieEntry, InUnit, OutDIE, OutUnit, and VarAddressAdjustment.
Referenced by DIEAttributeCloner(), and DIEAttributeCloner().
|
inline |
Definition at line 64 of file DIEAttributeCloner.h.
References DIEAttributeCloner(), FuncAddressAdjustment, Generator, HasLocationExpressionAddress, InputDieEntry, InUnit, OutDIE, OutUnit, and VarAddressAdjustment.
|
inlineprotected |
Definition at line 88 of file DIEAttributeCloner.h.
References llvm::dwarf_linker::DebugInfo, DebugInfoOutputSection, FuncAddressAdjustment, Generator, HasLocationExpressionAddress, InputDieEntry, InputDIEIdx, InUnit, OutDIE, OutUnit, SaveRelocs, Use_DW_FORM_strp, and VarAddressAdjustment.
| void DIEAttributeCloner::clone | ( | ) |
Clone attributes of input DIE.
Definition at line 17 of file DIEAttributeCloner.cpp.
References AttrInfo, AttrOutOffset, cloneAddressAttr(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), llvm::Data, llvm::dwarf_linker::DebugAddr, DebugInfoOutputSection, llvm::dwarf_linker::DebugStrOffsets, llvm::DWARFFormValue::extractValue(), llvm::dwarf::FormEncodingString(), Generator, llvm::getULEB128Size(), InputDieEntry, InputDIEIdx, InUnit, llvm::Offset, OutDIE, OutUnit, PatchesOffsets, SaveRelocs, shouldSkipAttribute(), llvm::DWARFFormValue::skipValue(), and Source.
|
protected |
Clone address attribute.
Definition at line 711 of file DIEAttributeCloner.cpp.
References llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, AttrInfo, constrainHighPC(), llvm::DWARFAbbreviationDeclaration::AttributeSpec::Form, FuncAddressAdjustment, Generator, llvm::DWARFFormValue::getRawUValue(), InputDieEntry, InUnit, llvm_unreachable, OutUnit, Source, and VarAddressAdjustment.
Referenced by clone().
|
protected |
Clone block or exprloc attribute.
Definition at line 645 of file DIEAttributeCloner.cpp.
References assert(), llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, AttrInfo, AttrOutOffset, llvm::Data, DebugInfoOutputSection, expressionDependsOnOriginUnit(), llvm::DWARFFormValue::FC_Block, llvm::DWARFFormValue::FC_Exprloc, llvm::DWARFAbbreviationDeclaration::AttributeSpec::Form, Generator, llvm::DWARFFormValue::getAsBlock(), HasLocationExpressionAddress, InUnit, llvm::DWARFFormValue::isFormClass(), llvm::DWARFAttribute::mayHaveLocationExpr(), OutUnit, PatchesOffsets, SaveRelocs, llvm::ArrayRef< T >::size(), Source, and VarAddressAdjustment.
Referenced by clone().
|
protected |
Clone attribute referencing another DIE.
Definition at line 277 of file DIEAttributeCloner.cpp.
References assert(), llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, AttrOutOffset, DebugInfoOutputSection, Generator, InputDieEntry, InputDIEIdx, InUnit, llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::needToPlaceInTypeTable(), OutDIE, OutUnit, PatchesOffsets, and llvm::dwarf_linker::parallel::Resolve.
Referenced by clone().
|
protected |
Clone scalar attribute.
Definition at line 370 of file DIEAttributeCloner.cpp.
References llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, AttrInfo, AttrOutOffset, constrainHighPC(), llvm::dwarf_linker::DebugAddr, DebugInfoOutputSection, llvm::dwarf_linker::DebugLine, llvm::dwarf_linker::DebugMacinfo, llvm::dwarf_linker::DebugMacro, llvm::dwarf_linker::DebugStrOffsets, llvm::dwarf::doesFormBelongToClass(), llvm::DWARFFormValue::FC_SectionOffset, llvm::DWARFAbbreviationDeclaration::AttributeSpec::Form, FuncAddressAdjustment, Generator, llvm::DWARFFormValue::getAsSectionOffset(), llvm::DWARFFormValue::getAsSignedConstant(), llvm::DWARFFormValue::getAsUnsignedConstant(), InputDieEntry, InputDIEIdx, InUnit, llvm::Macro, llvm::DWARFAttribute::mayHaveLocationList(), llvm::Offset, OutDIE, OutUnit, PatchesOffsets, and VarAddressAdjustment.
Referenced by clone().
|
protected |
Clone string attribute.
Definition at line 215 of file DIEAttributeCloner.cpp.
References llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, AttrInfo, AttrOutOffset, DebugInfoOutputSection, llvm::DWARFAbbreviationDeclaration::AttributeSpec::Form, Generator, InputDieEntry, InputDIEIdx, InUnit, llvm::dwarf_linker::isPathAttribute(), OutDIE, OutUnit, PatchesOffsets, llvm::String, llvm::dwarf::toString(), and Use_DW_FORM_strp.
Referenced by clone().
Returns the input DIE's DW_AT_high_pc value HighPC, constrained so the code range it ends stays clear of the symbol the linker places next.
IsLength tells whether high_pc is encoded as a length rather than an address.
A scope nested in a function inherits the overrun of the function, so it is constrained as well.
Definition at line 786 of file DIEAttributeCloner.cpp.
References FuncAddressAdjustment, InputDieEntry, InUnit, and llvm::dwarf::toAddress().
Referenced by cloneAddressAttr(), and cloneScalarAttr().
Create abbreviations for the output DIE after all attributes are cloned.
Definition at line 799 of file DIEAttributeCloner.cpp.
References AttrOutOffset, Generator, OutUnit, PatchesOffsets, and SaveRelocs.
|
inline |
Definition at line 85 of file DIEAttributeCloner.h.
References AttrOutOffset.
|
protected |
Returns true if attribute should be skipped.
Definition at line 171 of file DIEAttributeCloner.cpp.
References llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, FuncAddressAdjustment, HasLocationExpressionAddress, InputDIEIdx, InUnit, and VarAddressAdjustment.
Referenced by clone().
| AttributesInfo llvm::dwarf_linker::parallel::DIEAttributeCloner::AttrInfo |
Cannot be used concurrently.
Definition at line 83 of file DIEAttributeCloner.h.
Referenced by clone(), cloneAddressAttr(), cloneBlockAttr(), cloneScalarAttr(), and cloneStringAttr().
|
protected |
Output offset after all attributes.
Definition at line 186 of file DIEAttributeCloner.h.
Referenced by clone(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), finalizeAbbreviations(), and getOutOffset().
|
protected |
.debug_info section descriptor.
Definition at line 164 of file DIEAttributeCloner.h.
Referenced by clone(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), and DIEAttributeCloner().
|
protected |
Relocation adjustment for the function address ranges.
Definition at line 176 of file DIEAttributeCloner.h.
Referenced by cloneAddressAttr(), cloneScalarAttr(), constrainHighPC(), DIEAttributeCloner(), DIEAttributeCloner(), DIEAttributeCloner(), and shouldSkipAttribute().
|
protected |
Output DIE generator.
Definition at line 173 of file DIEAttributeCloner.h.
Referenced by clone(), cloneAddressAttr(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), DIEAttributeCloner(), DIEAttributeCloner(), DIEAttributeCloner(), and finalizeAbbreviations().
|
protected |
Indicates whether InputDieEntry has an location attribute containg address expression.
Definition at line 183 of file DIEAttributeCloner.h.
Referenced by cloneBlockAttr(), DIEAttributeCloner(), DIEAttributeCloner(), DIEAttributeCloner(), and shouldSkipAttribute().
|
protected |
Definition at line 167 of file DIEAttributeCloner.h.
Referenced by clone(), cloneAddressAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), constrainHighPC(), DIEAttributeCloner(), DIEAttributeCloner(), and DIEAttributeCloner().
|
protected |
Definition at line 170 of file DIEAttributeCloner.h.
Referenced by clone(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), DIEAttributeCloner(), and shouldSkipAttribute().
|
protected |
Input compilation unit.
Definition at line 158 of file DIEAttributeCloner.h.
Referenced by clone(), cloneAddressAttr(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), constrainHighPC(), DIEAttributeCloner(), DIEAttributeCloner(), DIEAttributeCloner(), and shouldSkipAttribute().
|
protected |
Output DIE.
Definition at line 155 of file DIEAttributeCloner.h.
Referenced by clone(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), DIEAttributeCloner(), DIEAttributeCloner(), and DIEAttributeCloner().
|
protected |
Output unit(either "plain" compilation unit, either artificial type unit).
Definition at line 161 of file DIEAttributeCloner.h.
Referenced by clone(), cloneAddressAttr(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), DIEAttributeCloner(), DIEAttributeCloner(), DIEAttributeCloner(), and finalizeAbbreviations().
|
protected |
Patches for the cloned attributes.
Definition at line 189 of file DIEAttributeCloner.h.
Referenced by clone(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), and finalizeAbbreviations().
|
protected |
Definition at line 193 of file DIEAttributeCloner.h.
Referenced by clone(), cloneBlockAttr(), DIEAttributeCloner(), and finalizeAbbreviations().
|
protected |
Definition at line 191 of file DIEAttributeCloner.h.
Referenced by clone(), cloneAddressAttr(), and cloneBlockAttr().
|
protected |
This flag forces using DW_FORM_strp for string attributes.
Definition at line 196 of file DIEAttributeCloner.h.
Referenced by cloneStringAttr(), and DIEAttributeCloner().
|
protected |
Relocation adjustment for the variable locations.
Definition at line 179 of file DIEAttributeCloner.h.
Referenced by cloneAddressAttr(), cloneBlockAttr(), cloneScalarAttr(), DIEAttributeCloner(), DIEAttributeCloner(), DIEAttributeCloner(), and shouldSkipAttribute().