LLVM 20.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 > |
Static Public Member Functions | |
static DIE * | get (BumpPtrAllocator &Alloc, dwarf::Tag Tag) |
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().
|
delete |
Add a child to the DIE.
Definition at line 934 of file DIE.h.
References assert(), and getParent().
Referenced by llvm::dwarf_linker::parallel::DIEGenerator::addChild(), llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs(), llvm::DwarfCompileUnit::constructImportedEntityDIE(), llvm::DwarfCompileUnit::constructInlinedScopeDIE(), llvm::DwarfCompileUnit::constructScopeDIE(), llvm::DwarfCompileUnit::constructSubprogramScopeDIE(), llvm::DwarfUnit::createAndAddDIE(), llvm::DwarfCompileUnit::createAndAddScopeChildren(), and llvm::DwarfCompileUnit::getOrCreateImportedEntityDIE().
Definition at line 941 of file DIE.h.
References assert(), and getParent().
Referenced by llvm::DwarfCompileUnit::createBaseTypeDIEs().
|
inline |
Definition at line 875 of file DIE.h.
References llvm::make_range().
Referenced by computeOffsetsAndAbbrevs(), llvm::AsmPrinter::emitDwarfDIE(), and print().
|
inline |
Definition at line 878 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 266 of file DIE.cpp.
References assert(), children(), getAbbrevNumber(), getOffset(), llvm::getULEB128Size(), llvm::DIEAbbrev::hasChildren(), hasChildren(), setOffset(), setSize(), llvm::DIEAbbrevSet::uniqueAbbreviation(), and llvm::DIEValueList::values().
Referenced by llvm::DwarfFile::computeSizeAndOffset().
LLVM_DUMP_METHOD void DIE::dump | ( | ) | const |
Definition at line 261 of file DIE.cpp.
References llvm::dbgs(), and print().
Referenced by llvm::dwarf_linker::parallel::DependencyTracker::isLiveSubprogramEntry(), and llvm::dwarf_linker::parallel::DependencyTracker::isLiveVariableEntry().
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 210 of file DIE.cpp.
References llvm::DIEValueList::values().
Referenced by computeIndexValue(), llvm::DwarfCompileUnit::constructCallSiteEntryDIE(), 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 174 of file DIE.cpp.
References llvm::DIEAbbrev::AddAttribute(), llvm::DIEAbbrev::AddImplicitConstAttribute(), hasChildren(), and llvm::DIEValueList::values().
Referenced by llvm::dwarf_linker::parallel::DIEGenerator::finalizeAbbreviations(), and llvm::DIEAbbrevSet::uniqueAbbreviation().
|
inlinestatic |
Definition at line 849 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::constructLexicalScopeDIE(), llvm::DwarfCompileUnit::constructSubprogramScopeDIE(), llvm::DwarfCompileUnit::constructVariableDIE(), llvm::DwarfUnit::createAndAddDIE(), llvm::DwarfCompileUnit::createBaseTypeDIEs(), and llvm::dwarf_linker::parallel::DIEGenerator::createDIE().
|
inline |
Definition at line 854 of file DIE.h.
Referenced by computeOffsetsAndAbbrevs(), llvm::dwarf_linker::parallel::TypeUnit::createDIETree(), llvm::AsmPrinter::emitDwarfDIE(), and llvm::dwarf_linker::parallel::DIEGenerator::finalizeAbbreviations().
uint64_t DIE::getDebugSectionOffset | ( | ) | const |
Get the absolute offset within the .debug_info or .debug_types section for this DIE.
Definition at line 185 of file DIE.cpp.
References assert(), getOffset(), and getUnit().
Referenced by llvm::AppleAccelTableOffsetData::emit(), llvm::AppleAccelTableTypeData::emit(), and llvm::DIEEntry::emitValue().
|
inline |
Get the compile/type unit relative offset of this DIE.
Definition at line 857 of file DIE.h.
References assert(), and Offset.
Referenced by llvm::dwarf_linker::parallel::OutputSections::applyPatches(), llvm::dwarf_linker::parallel::DIEAttributeCloner::clone(), computeOffsetsAndAbbrevs(), llvm::dwarf_linker::parallel::TypeUnit::createDIETree(), llvm::AsmPrinter::emitDwarfDIE(), llvm::DIEEntry::emitValue(), llvm::dwarf_linker::classic::CompileUnit::fixupForwardReferences(), getDebugSectionOffset(), llvm::DWARFUnit::getDIEIndexForOffset(), llvm::dwarf_linker::AddressesMap::getVariableRelocAdjustment(), llvm::AppleAccelTableOffsetData::order(), llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::saveNameRecord(), llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::saveNamespaceRecord(), llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::saveObjCNameRecord(), llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::saveTypeRecord(), and llvm::DIEEntry::sizeOf().
DIE * DIE::getParent | ( | ) | const |
Definition at line 172 of file DIE.cpp.
Referenced by addChild(), addChildFront(), llvm::DIEHash::computeTypeSignature(), and llvm::DWARF5AccelTableData::getDefiningParentDieOffset().
|
inline |
Definition at line 862 of file DIE.h.
References assert(), and Size.
Referenced by llvm::dwarf_linker::parallel::DwarfEmitterImpl::emitDIE(), llvm::dwarf_linker::classic::DwarfStreamer::emitDIE(), llvm::AsmPrinter::emitDwarfDIE(), llvm::DwarfCompileUnit::getLength(), and llvm::dwarf_linker::parallel::DwarfUnit::setOutUnitDIE().
|
inline |
Definition at line 855 of file DIE.h.
Referenced by computeIndexValue(), llvm::DwarfUnit::constructTypeDIE(), llvm::AppleAccelTableTypeData::emit(), 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(), llvm::dwarf_linker::classic::CompileUnit::markEverythingAsKept(), llvm::dwarf_linker::classic::CompileUnit::noteRangeAttribute(), print(), and llvm::dwarf_linker::parallel::DwarfUnit::setOutUnitDIE().
DIEUnit * DIE::getUnit | ( | ) | const |
Climb up the parent chain to get the compile unit or type unit that this DIE belongs to.
Definition at line 203 of file DIE.cpp.
References getUnitDie().
Referenced by llvm::DwarfUnit::addDIEEntry(), llvm::DIEEntry::emitValue(), getDebugSectionOffset(), llvm::DwarfUnit::getOrCreateSubprogramDIE(), and llvm::DwarfUnit::getOrCreateTypeDIE().
Climb up the parent chain to get the compile unit or type unit DIE that this DIE belongs to.
Definition at line 191 of file DIE.cpp.
Referenced by llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE(), and getUnit().
|
inline |
Definition at line 867 of file DIE.h.
Referenced by computeOffsetsAndAbbrevs(), llvm::AsmPrinter::emitDwarfDIE(), generateAbbrev(), llvm::DwarfUnit::hasContent(), and print().
LLVM_DUMP_METHOD void DIE::print | ( | raw_ostream & | O, |
unsigned | IndentCount = 0 |
||
) | const |
Definition at line 236 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().
|
inline |
Set the abbreviation number for this DIE.
Definition at line 891 of file DIE.h.
References I.
Referenced by llvm::dwarf_linker::parallel::DIEGenerator::finalizeAbbreviations(), and llvm::DIEAbbrevSet::uniqueAbbreviation().
|
inline |
|
inline |
Definition at line 930 of file DIE.h.
References Offset.
Referenced by computeOffsetsAndAbbrevs(), llvm::dwarf_linker::parallel::DIEGenerator::createDIE(), and llvm::dwarf_linker::parallel::TypeUnit::createDIETree().
|
inline |
Definition at line 931 of file DIE.h.
References Size.
Referenced by computeOffsetsAndAbbrevs(), and llvm::dwarf_linker::parallel::TypeUnit::createDIETree().
|
friend |