|
LLVM 24.0.0git
|
A structured debug information entry. More...
#include "llvm/CodeGen/DIE.h"
Public Types | |
| using | child_iterator = IntrusiveBackList<DIE>::iterator |
| using | const_child_iterator = IntrusiveBackList<DIE>::const_iterator |
| using | child_range = iterator_range<child_iterator> |
| using | const_child_range = iterator_range<const_child_iterator> |
| Public Types inherited from llvm::DIEValueList | |
| using | value_range = iterator_range<value_iterator> |
| using | const_value_range = iterator_range<const_value_iterator> |
Public Member Functions | |
| DIE ()=delete | |
| DIE (const DIE &RHS)=delete | |
| DIE (DIE &&RHS)=delete | |
| DIE & | operator= (const DIE &RHS)=delete |
| DIE & | operator= (const DIE &&RHS)=delete |
| unsigned | getAbbrevNumber () const |
| dwarf::Tag | getTag () const |
| unsigned | getOffset () const |
| Get the compile/type unit relative offset of this DIE. | |
| unsigned | getSize () const |
| bool | hasChildren () const |
| bool | isPlaceholder () const |
| Returns true if DIE is a temporary placeholder. | |
| child_range | children () |
| const_child_range | children () const |
| LLVM_ABI DIE * | getParent () const |
| LLVM_ABI DIEAbbrev | generateAbbrev () const |
| Generate the abbreviation for this DIE. | |
| void | setAbbrevNumber (unsigned I) |
| Set the abbreviation number for this DIE. | |
| LLVM_ABI uint64_t | getDebugSectionOffset () const |
| Get the absolute offset within the .debug_info or .debug_types section for this DIE. | |
| LLVM_ABI unsigned | computeOffsetsAndAbbrevs (const dwarf::FormParams &FormParams, DIEAbbrevSet &AbbrevSet, unsigned CUOffset) |
| Compute the offset of this DIE and all its children. | |
| LLVM_ABI const DIE * | getUnitDie () const |
| Climb up the parent chain to get the unit DIE that this DIE belongs to. | |
| LLVM_ABI DIEUnit * | getUnit () const |
| Climb up the parent chain to get the unit that this DIE belongs to. | |
| void | setOffset (unsigned O) |
| void | setSize (unsigned S) |
| DIE & | addChild (DIE *Child) |
| Add a child to the DIE. | |
| DIE & | addChildFront (DIE *Child) |
| LLVM_ABI void | removeChild (DIE &Child) |
Remove Child from the children of this DIE. | |
| LLVM_ABI void | takeChildren (DIE &Other, bool AtFront=false) |
Move all children of Other to this DIE, preserving their order. | |
| LLVM_ABI DIEValue | findAttribute (dwarf::Attribute Attribute) const |
| Find a value in the DIE with the attribute given. | |
| LLVM_ABI void | print (raw_ostream &O, unsigned IndentCount=0) const |
| LLVM_ABI void | dump () const |
| Public Member Functions inherited from llvm::DIEValueList | |
| value_iterator | addValue (BumpPtrAllocator &Alloc, const DIEValue &V) |
| template<class T> | |
| value_iterator | addValue (BumpPtrAllocator &Alloc, dwarf::Attribute Attribute, dwarf::Form Form, T &&Value) |
| template<class T> | |
| bool | replaceValue (BumpPtrAllocator &Alloc, dwarf::Attribute Attribute, dwarf::Attribute NewAttribute, dwarf::Form Form, T &&NewValue) |
| template<class T> | |
| bool | replaceValue (BumpPtrAllocator &Alloc, dwarf::Attribute Attribute, dwarf::Form Form, T &&NewValue) |
| bool | replaceValue (BumpPtrAllocator &Alloc, dwarf::Attribute Attribute, dwarf::Form Form, DIEValue &NewValue) |
| bool | deleteValue (dwarf::Attribute Attribute) |
| void | takeValues (DIEValueList &Other) |
Take ownership of the nodes in Other, and append them to the back of the list. | |
| value_range | values () |
| const_value_range | values () const |
Static Public Member Functions | |
| static DIE * | get (BumpPtrAllocator &Alloc, dwarf::Tag Tag) |
| static DIE * | getPlaceholder (BumpPtrAllocator &Alloc) |
| Create a temporary placeholder DIE. | |
Static Public Attributes | |
| static constexpr dwarf::Tag | PlaceholderTag = dwarf::DW_TAG_null |
| Internal tag for temporary containers. | |
Friends | |
| class | IntrusiveBackList< DIE > |
| class | DIEUnit |
A structured debug information entry.
Has an abbreviation which describes its organization.
| using llvm::DIE::child_iterator = IntrusiveBackList<DIE>::iterator |
|
delete |
Referenced by get().
Add a child to the DIE.
Definition at line 960 of file DIE.h.
References assert().
Referenced by llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs(), llvm::DwarfCompileUnit::constructImportedEntityDIE(), llvm::DwarfCompileUnit::constructInlinedScopeDIE(), llvm::DwarfCompileUnit::constructSubprogramScopeDIE(), llvm::DwarfUnit::createAndAddDIE(), llvm::DwarfCompileUnit::createAndAddScopeChildren(), llvm::DwarfCompileUnit::getOrCreateImportedEntityDIE(), and llvm::DwarfCompileUnit::getOrCreateLexicalBlockDIE().
Definition at line 967 of file DIE.h.
References assert().
Referenced by llvm::DwarfCompileUnit::createBaseTypeDIEs().
|
inline |
Definition at line 902 of file DIE.h.
References llvm::make_range().
Referenced by llvm::appendUnnamedTypeContents(), computeOffsetsAndAbbrevs(), llvm::AsmPrinter::emitDwarfDIE(), and print().
|
inline |
Definition at line 905 of file DIE.h.
References llvm::make_range().
| unsigned DIE::computeOffsetsAndAbbrevs | ( | const dwarf::FormParams & | FormParams, |
| DIEAbbrevSet & | AbbrevSet, | ||
| unsigned | CUOffset ) |
Compute the offset of this DIE and all its children.
This function gets called just before we are going to generate the debug information and gives each DIE a chance to figure out its CU relative DIE offset, unique its abbreviation and fill in the abbreviation code, and return the unit offset that points to where the next DIE will be emitted within the debug unit section. After this function has been called for all DIE objects, the DWARF can be generated since all DIEs will be able to properly refer to other DIE objects since all DIEs have calculated their offsets.
| FormParams | Used when calculating sizes. |
| AbbrevSet | the abbreviation used to unique DIE abbreviations. |
| CUOffset | the compile/type unit relative offset in bytes. |
Definition at line 291 of file DIE.cpp.
References assert(), children(), getAbbrevNumber(), getOffset(), llvm::getULEB128Size(), hasChildren(), llvm::DIEAbbrev::hasChildren(), isPlaceholder(), setOffset(), setSize(), llvm::DIEAbbrevSet::uniqueAbbreviation(), and llvm::DIEValueList::values().
Referenced by llvm::DwarfFile::computeSizeAndOffset().
| LLVM_DUMP_METHOD void DIE::dump | ( | ) | const |
Definition at line 286 of file DIE.cpp.
References llvm::dbgs(), LLVM_DUMP_METHOD, and print().
Referenced by dumpKeptDIE().
| DIEValue DIE::findAttribute | ( | dwarf::Attribute | Attribute | ) | const |
Find a value in the DIE with the attribute given.
Returns a default-constructed DIEValue (where DIEValue::getType() gives DIEValue::isNone) if no such attribute exists.
Definition at line 235 of file DIE.cpp.
References llvm::DIEValueList::values().
Referenced by llvm::DwarfCompileUnit::addLinkageNamesToDeclarations(), computeIndexValue(), and llvm::DWARF5AccelTableData::getDefiningParentDieOffset().
| DIEAbbrev DIE::generateAbbrev | ( | ) | const |
Generate the abbreviation for this DIE.
Calculate the abbreviation for this, which should be uniqued and eventually used to call setAbbrevNumber().
Definition at line 203 of file DIE.cpp.
References llvm::DIEAbbrev::AddAttribute(), llvm::DIEAbbrev::AddImplicitConstAttribute(), assert(), hasChildren(), isPlaceholder(), and llvm::DIEValueList::values().
Referenced by llvm::DIEAbbrevSet::uniqueAbbreviation().
|
inlinestatic |
Definition at line 869 of file DIE.h.
References llvm::Alloc, and DIE().
Referenced by llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs(), llvm::DwarfCompileUnit::constructImportedEntityDIE(), llvm::DwarfCompileUnit::constructInlinedScopeDIE(), llvm::DwarfCompileUnit::constructLabelDIE(), llvm::DwarfCompileUnit::constructSubprogramScopeDIE(), llvm::DwarfCompileUnit::constructVariableDIE(), llvm::DwarfUnit::createAndAddDIE(), llvm::DwarfCompileUnit::createBaseTypeDIEs(), llvm::dwarf_linker::parallel::DIEGenerator::createDIE(), llvm::DwarfCompileUnit::getOrCreateLexicalBlockDIE(), and getPlaceholder().
|
inline |
Definition at line 879 of file DIE.h.
Referenced by computeOffsetsAndAbbrevs(), llvm::dwarf_linker::parallel::TypeUnit::createDIETree(), and llvm::AsmPrinter::emitDwarfDIE().
| uint64_t DIE::getDebugSectionOffset | ( | ) | const |
|
inline |
Get the compile/type unit relative offset of this DIE.
Definition at line 882 of file DIE.h.
References assert().
Referenced by llvm::dwarf_linker::parallel::OutputSections::applyPatches(), computeOffsetsAndAbbrevs(), llvm::dwarf_linker::parallel::TypeUnit::createDIETree(), llvm::AsmPrinter::emitDwarfDIE(), llvm::dwarf_linker::classic::CompileUnit::fixupForwardReferences(), getDebugSectionOffset(), llvm::DWARFUnit::getDIEIndexForOffset(), llvm::dwarf_linker::AddressesMap::getVariableRelocAdjustment(), llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::saveNameRecord(), llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::saveNamespaceRecord(), llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::saveObjCNameRecord(), and llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::saveTypeRecord().
| DIE * DIE::getParent | ( | ) | const |
Definition at line 176 of file DIE.cpp.
References assert(), and isPlaceholder().
Referenced by llvm::DIEHash::computeTypeSignature(), and llvm::DWARF5AccelTableData::getDefiningParentDieOffset().
|
inlinestatic |
Create a temporary placeholder DIE.
Definition at line 874 of file DIE.h.
References llvm::Alloc, get(), and PlaceholderTag.
|
inline |
Definition at line 887 of file DIE.h.
References assert().
Referenced by llvm::dwarf_linker::classic::DwarfStreamer::emitDIE(), llvm::dwarf_linker::parallel::DwarfEmitterImpl::emitDIE(), llvm::AsmPrinter::emitDwarfDIE(), and llvm::DwarfCompileUnit::getLength().
|
inline |
Definition at line 880 of file DIE.h.
Referenced by llvm::appendUnnamedTypeContents(), computeIndexValue(), llvm::DwarfUnit::constructTypeDIE(), llvm::AsmPrinter::emitDwarfDIE(), llvm::dwarf_linker::classic::DeclContextTree::getChildDeclContext(), llvm::DWARFContext::getDIEsForAddress(), getNames(), llvm::DwarfUnit::getOrCreateStaticMemberDIE(), llvm::dwarf_linker::AddressesMap::getVariableRelocAdjustment(), llvm::dwarf_linker::parallel::DependencyTracker::isLiveSubprogramEntry(), isPlaceholder(), llvm::dwarf_linker::classic::CompileUnit::markEverythingAsKept(), llvm::dwarf_linker::classic::CompileUnit::noteRangeAttribute(), and print().
| DIEUnit * DIE::getUnit | ( | ) | const |
Climb up the parent chain to get the unit that this DIE belongs to.
Definition at line 223 of file DIE.cpp.
References DIEUnit, llvm::dyn_cast_if_present(), and P.
Referenced by llvm::DwarfUnit::addDIEEntry(), getDebugSectionOffset(), llvm::DwarfUnit::getOrCreateStaticMemberDIE(), llvm::DwarfUnit::getOrCreateSubprogramDIE(), llvm::DwarfUnit::getOrCreateTypeDIE(), and getUnitDie().
|
inline |
Definition at line 892 of file DIE.h.
Referenced by computeOffsetsAndAbbrevs(), llvm::AsmPrinter::emitDwarfDIE(), generateAbbrev(), and print().
|
inline |
Returns true if DIE is a temporary placeholder.
Definition at line 895 of file DIE.h.
References getTag(), and PlaceholderTag.
Referenced by computeOffsetsAndAbbrevs(), llvm::AsmPrinter::emitDwarfDIE(), generateAbbrev(), and getParent().
| LLVM_DUMP_METHOD void DIE::print | ( | raw_ostream & | O, |
| unsigned | IndentCount = 0 ) const |
Definition at line 261 of file DIE.cpp.
References llvm::dwarf::AttributeString(), children(), llvm::dwarf::ChildrenString(), llvm::format(), llvm::dwarf::FormEncodingString(), getTag(), hasChildren(), llvm::dwarf::TagString(), and llvm::DIEValueList::values().
Referenced by dump().
| void DIE::removeChild | ( | DIE & | Child | ) |
Remove Child from the children of this DIE.
Takes constant time if Child is the first child, and linear time otherwise.
Definition at line 183 of file DIE.cpp.
References assert().
Referenced by llvm::DwarfCompileUnit::resolvePendingLocalScopeDIEs().
|
inline |
Set the abbreviation number for this DIE.
Definition at line 918 of file DIE.h.
References I.
Referenced by llvm::DIEAbbrevSet::uniqueAbbreviation().
|
inline |
Definition at line 956 of file DIE.h.
Referenced by computeOffsetsAndAbbrevs(), and llvm::dwarf_linker::parallel::TypeUnit::createDIETree().
|
inline |
Definition at line 957 of file DIE.h.
Referenced by computeOffsetsAndAbbrevs(), and llvm::dwarf_linker::parallel::TypeUnit::createDIETree().
Move all children of Other to this DIE, preserving their order.
If AtFront is true, the moved children are placed before the existing children of this DIE, otherwise after them.
Definition at line 190 of file DIE.cpp.
References llvm::Other, and llvm::IntrusiveBackList< T >::takeNodes().
Referenced by llvm::DwarfCompileUnit::resolvePendingLocalScopeDIEs().
|
friend |
Definition at line 837 of file DIE.h.
References DIEUnit.
Referenced by DIEUnit, getDebugSectionOffset(), getUnit(), and getUnitDie().
|
friend |
|
staticconstexpr |
Internal tag for temporary containers.
Such DIEs must be removed before abbreviation generation or emission.
Definition at line 861 of file DIE.h.
Referenced by llvm::DIEAbbrev::Emit(), getPlaceholder(), and isPlaceholder().