LLVM 20.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. | |
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 47 of file DIEAttributeCloner.h.
|
inline |
Definition at line 49 of file DIEAttributeCloner.h.
|
inline |
Definition at line 61 of file DIEAttributeCloner.h.
|
inlineprotected |
Definition at line 85 of file DIEAttributeCloner.h.
References llvm::dwarf_linker::parallel::DWARFLinkerOptions::AllowNonDeterministicOutput, llvm::dwarf_linker::parallel::CompileUnit::getDIEIndex(), llvm::dwarf_linker::parallel::DwarfUnit::getGlobalData(), llvm::dwarf_linker::parallel::LinkingGlobalData::getOptions(), llvm::dwarf_linker::parallel::OutputSections::getVersion(), InputDieEntry, InputDIEIdx, InUnit, llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::isTypeUnit(), OutUnit, llvm::dwarf_linker::parallel::DWARFLinkerOptions::Threads, and Use_DW_FORM_strp.
void DIEAttributeCloner::clone | ( | ) |
Clone attributes of input DIE.
Definition at line 16 of file DIEAttributeCloner.cpp.
References llvm::dwarf_linker::DWARFFile::Addresses, llvm::dwarf_linker::parallel::DIEGenerator::addScalarAttribute(), AttrInfo, AttrOutOffset, cloneAddressAttr(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), llvm::Data, DebugInfoOutputSection, llvm::dwarf_linker::DebugStrOffsets, llvm::DWARFFormValue::extractValue(), llvm::dwarf::FormEncodingString(), Generator, llvm::DWARFDebugInfoEntry::getAbbreviationDeclarationPtr(), llvm::dwarf_linker::parallel::CompileUnit::getContaingFile(), llvm::DWARFUnit::getDebugInfoExtractor(), llvm::dwarf_linker::parallel::OutputSections::getDebugStrOffsetsHeaderSize(), llvm::dwarf_linker::parallel::CompileUnit::getDIEAtIndex(), llvm::dwarf_linker::parallel::OutputSections::getFormParams(), llvm::DWARFUnit::getNextUnitOffset(), llvm::DWARFUnit::getNumDIEs(), llvm::DIE::getOffset(), llvm::DWARFDebugInfoEntry::getOffset(), llvm::DWARFDie::getOffset(), llvm::dwarf_linker::parallel::OutputSections::getOrCreateSectionDescriptor(), llvm::dwarf_linker::parallel::CompileUnit::getOrigUnit(), llvm::DWARFDebugInfoEntry::getTag(), llvm::getULEB128Size(), llvm::dwarf_linker::parallel::OutputSections::getVersion(), llvm::dwarf_linker::parallel::AttributesInfo::HasStringOffsetBaseAttr, InputDieEntry, InputDIEIdx, InUnit, llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::isCompileUnit(), llvm::dwarf_linker::parallel::SectionDescriptor::notePatchWithOffsetUpdate(), llvm::Offset, OutDIE, OutUnit, PatchesOffsets, shouldSkipAttribute(), llvm::DWARFFormValue::skipValue(), and llvm::dwarf_linker::parallel::CompileUnit::warn().
|
protected |
Clone address attribute.
Definition at line 580 of file DIEAttributeCloner.cpp.
References Addr, llvm::dwarf_linker::parallel::DIEGenerator::addScalarAttribute(), llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, AttrInfo, llvm::dwarf_linker::parallel::CompileUnit::find(), llvm::DWARFAbbreviationDeclaration::AttributeSpec::Form, FuncAddressAdjustment, Generator, llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::getAsCompileUnit(), llvm::dwarf_linker::parallel::CompileUnit::getDebugAddrIndex(), llvm::dwarf_linker::parallel::DwarfUnit::getGlobalData(), llvm::dwarf_linker::parallel::CompileUnit::getHighPc(), llvm::dwarf_linker::parallel::CompileUnit::getLowPc(), llvm::dwarf_linker::parallel::LinkingGlobalData::getOptions(), llvm::DWARFFormValue::getRawUValue(), llvm::DWARFDebugInfoEntry::getTag(), llvm::dwarf_linker::parallel::AttributesInfo::HasLiveAddress, InputDieEntry, InUnit, llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::isTypeUnit(), llvm_unreachable, OutUnit, llvm::dwarf_linker::parallel::DWARFLinkerOptions::UpdateIndexTablesOnly, VarAddressAdjustment, and llvm::dwarf_linker::parallel::CompileUnit::warn().
Referenced by clone().
|
protected |
Clone block or exprloc attribute.
Definition at line 521 of file DIEAttributeCloner.cpp.
References llvm::dwarf_linker::parallel::DIEGenerator::addBlockAttribute(), llvm::dwarf_linker::parallel::DIEGenerator::addLocationAttribute(), assert(), llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, AttrInfo, AttrOutOffset, llvm::dwarf_linker::parallel::CompileUnit::cloneDieAttrExpression(), llvm::ArrayRef< T >::data(), llvm::Data, DebugInfoOutputSection, llvm::DWARFFormValue::FC_Block, llvm::DWARFFormValue::FC_Exprloc, llvm::DWARFAbbreviationDeclaration::AttributeSpec::Form, llvm::dwarf::FormParams::Format, Generator, llvm::DWARFUnit::getAddressByteSize(), llvm::DWARFFormValue::getAsBlock(), llvm::dwarf_linker::parallel::OutputSections::getFormParams(), llvm::dwarf_linker::parallel::DwarfUnit::getGlobalData(), llvm::dwarf_linker::parallel::LinkingGlobalData::getOptions(), llvm::dwarf_linker::parallel::CompileUnit::getOrigUnit(), llvm::dwarf_linker::parallel::AttributesInfo::HasLiveAddress, HasLocationExpressionAddress, Idx, InUnit, llvm::DWARFFormValue::isFormClass(), llvm::DWARFUnit::isLittleEndian(), llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::isTypeUnit(), llvm::DWARFAttribute::mayHaveLocationExpr(), OutUnit, PatchesOffsets, llvm::ArrayRef< T >::size(), llvm::SmallVectorBase< Size_T >::size(), llvm::dwarf_linker::parallel::DWARFLinkerOptions::UpdateIndexTablesOnly, and VarAddressAdjustment.
Referenced by clone().
|
protected |
Clone attribute referencing another DIE.
Definition at line 236 of file DIEAttributeCloner.cpp.
References llvm::dwarf_linker::parallel::DIEGenerator::addScalarAttribute(), assert(), llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, AttrOutOffset, DebugInfoOutputSection, Generator, llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::getAsCompileUnit(), llvm::dwarf_linker::parallel::CompileUnit::getDIEIndex(), llvm::dwarf_linker::parallel::CompileUnit::getDieTypeEntry(), llvm::dwarf_linker::parallel::DwarfUnit::getUniqueID(), InputDieEntry, InputDIEIdx, InUnit, llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::isTypeUnit(), llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::needToPlaceInTypeTable(), llvm::dwarf_linker::parallel::SectionDescriptor::notePatchWithOffsetUpdate(), OutDIE, OutUnit, PatchesOffsets, llvm::dwarf_linker::parallel::Resolve, llvm::dwarf_linker::parallel::CompileUnit::resolveDIEReference(), and llvm::dwarf_linker::parallel::CompileUnit::warn().
Referenced by clone().
|
protected |
Clone scalar attribute.
Definition at line 304 of file DIEAttributeCloner.cpp.
References llvm::dwarf_linker::parallel::DIEGenerator::addLocListAttribute(), llvm::dwarf_linker::parallel::DIEGenerator::addScalarAttribute(), llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, AttrInfo, AttrOutOffset, 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::dwarf_linker::DWARFFile::Dwarf, llvm::DWARFFormValue::FC_SectionOffset, llvm::DWARFAbbreviationDeclaration::AttributeSpec::Form, FuncAddressAdjustment, Generator, llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::getAsCompileUnit(), llvm::DWARFFormValue::getAsSectionOffset(), llvm::DWARFFormValue::getAsSignedConstant(), llvm::DWARFFormValue::getAsUnsignedConstant(), llvm::dwarf_linker::parallel::CompileUnit::getContaingFile(), llvm::dwarf_linker::parallel::OutputSections::getDebugAddrHeaderSize(), llvm::dwarf_linker::parallel::OutputSections::getDebugStrOffsetsHeaderSize(), llvm::dwarf_linker::parallel::CompileUnit::getDieTypeEntry(), llvm::dwarf_linker::parallel::CompileUnit::getDirAndFilenameFromLineTable(), llvm::dwarf_linker::parallel::DwarfUnit::getGlobalData(), llvm::dwarf_linker::parallel::CompileUnit::getHighPc(), llvm::DWARFUnit::getLoclistOffset(), llvm::dwarf_linker::parallel::CompileUnit::getLowPc(), llvm::dwarf_linker::parallel::LinkingGlobalData::getOptions(), llvm::dwarf_linker::parallel::OutputSections::getOrCreateSectionDescriptor(), llvm::dwarf_linker::parallel::CompileUnit::getOrigUnit(), llvm::DWARFUnit::getRnglistOffset(), llvm::dwarf_linker::parallel::LinkingGlobalData::getStringPool(), llvm::DWARFDebugInfoEntry::getTag(), llvm::DWARFUnit::getVersion(), llvm::dwarf_linker::parallel::AttributesInfo::HasLiveAddress, llvm::dwarf_linker::parallel::AttributesInfo::HasRanges, llvm::dwarf_linker::parallel::AttributesInfo::HasStringOffsetBaseAttr, InputDieEntry, InputDIEIdx, llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::insert(), InUnit, llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::isCompileUnit(), llvm::dwarf_linker::parallel::AttributesInfo::IsDeclaration, llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::isTypeUnit(), llvm::Macro, llvm::DWARFAttribute::mayHaveLocationList(), llvm::dwarf_linker::parallel::SectionDescriptor::notePatchWithOffsetUpdate(), llvm::Offset, OutDIE, OutUnit, PatchesOffsets, llvm::dwarf_linker::parallel::DWARFLinkerOptions::UpdateIndexTablesOnly, VarAddressAdjustment, and llvm::dwarf_linker::parallel::CompileUnit::warn().
Referenced by clone().
|
protected |
Clone string attribute.
Definition at line 182 of file DIEAttributeCloner.cpp.
References llvm::dwarf_linker::parallel::DIEGenerator::addIndexedStringAttribute(), llvm::dwarf_linker::parallel::DIEGenerator::addStringPlaceholderAttribute(), llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, AttrInfo, AttrOutOffset, DebugInfoOutputSection, llvm::DWARFAbbreviationDeclaration::AttributeSpec::Form, Generator, llvm::dwarf_linker::parallel::DwarfUnit::getDebugStrIndex(), llvm::dwarf_linker::parallel::CompileUnit::getDieTypeEntry(), llvm::dwarf_linker::parallel::DwarfUnit::getGlobalData(), llvm::dwarf_linker::parallel::LinkingGlobalData::getStringPool(), if(), InputDIEIdx, llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::insert(), InUnit, llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::isTypeUnit(), llvm::dwarf_linker::parallel::AttributesInfo::MangledName, llvm::dwarf_linker::parallel::AttributesInfo::Name, llvm::dwarf_linker::parallel::SectionDescriptor::notePatchWithOffsetUpdate(), OutDIE, OutUnit, PatchesOffsets, llvm::String, llvm::dwarf::toString(), Use_DW_FORM_strp, and llvm::dwarf_linker::parallel::CompileUnit::warn().
Referenced by clone().
Create abbreviations for the output DIE after all attributes are cloned.
Definition at line 647 of file DIEAttributeCloner.cpp.
References AttrOutOffset, llvm::dwarf_linker::parallel::DIEGenerator::finalizeAbbreviations(), Generator, and PatchesOffsets.
|
inline |
Definition at line 82 of file DIEAttributeCloner.h.
References AttrOutOffset.
|
protected |
Returns true if attribute should be skipped.
Definition at line 138 of file DIEAttributeCloner.cpp.
References llvm::DWARFAbbreviationDeclaration::AttributeSpec::Attr, FuncAddressAdjustment, llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo(), llvm::dwarf_linker::parallel::DwarfUnit::getGlobalData(), llvm::dwarf_linker::parallel::LinkingGlobalData::getOptions(), HasLocationExpressionAddress, InputDIEIdx, InUnit, llvm::dwarf_linker::parallel::DWARFLinkerOptions::UpdateIndexTablesOnly, and VarAddressAdjustment.
Referenced by clone().
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().
|
protected |
Output offset after all attributes.
Definition at line 173 of file DIEAttributeCloner.h.
Referenced by clone(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), finalizeAbbreviations(), and getOutOffset().
|
protected |
.debug_info section descriptor.
Definition at line 151 of file DIEAttributeCloner.h.
Referenced by clone(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), and cloneStringAttr().
|
protected |
Relocation adjustment for the function address ranges.
Definition at line 163 of file DIEAttributeCloner.h.
Referenced by cloneAddressAttr(), cloneScalarAttr(), and shouldSkipAttribute().
|
protected |
Output DIE generator.
Definition at line 160 of file DIEAttributeCloner.h.
Referenced by clone(), cloneAddressAttr(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), and finalizeAbbreviations().
|
protected |
Indicates whether InputDieEntry has an location attribute containg address expression.
Definition at line 170 of file DIEAttributeCloner.h.
Referenced by cloneBlockAttr(), and shouldSkipAttribute().
|
protected |
Input DIE entry.
Definition at line 154 of file DIEAttributeCloner.h.
Referenced by clone(), cloneAddressAttr(), cloneDieRefAttr(), cloneScalarAttr(), and DIEAttributeCloner().
|
protected |
Input DIE index.
Definition at line 157 of file DIEAttributeCloner.h.
Referenced by clone(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), DIEAttributeCloner(), and shouldSkipAttribute().
|
protected |
Input compilation unit.
Definition at line 145 of file DIEAttributeCloner.h.
Referenced by clone(), cloneAddressAttr(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), DIEAttributeCloner(), and shouldSkipAttribute().
|
protected |
Output DIE.
Definition at line 142 of file DIEAttributeCloner.h.
Referenced by clone(), cloneDieRefAttr(), cloneScalarAttr(), and cloneStringAttr().
|
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(), and DIEAttributeCloner().
|
protected |
Patches for the cloned attributes.
Definition at line 176 of file DIEAttributeCloner.h.
Referenced by clone(), cloneBlockAttr(), cloneDieRefAttr(), cloneScalarAttr(), cloneStringAttr(), and finalizeAbbreviations().
|
protected |
This flag forces using DW_FORM_strp for string attributes.
Definition at line 179 of file DIEAttributeCloner.h.
Referenced by cloneStringAttr(), and DIEAttributeCloner().
|
protected |
Relocation adjustment for the variable locations.
Definition at line 166 of file DIEAttributeCloner.h.
Referenced by cloneAddressAttr(), cloneBlockAttr(), cloneScalarAttr(), and shouldSkipAttribute().