LLVM 17.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 > |
![]() | |
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 |
void | setForceChildren (bool B) |
child_range | children () |
const_child_range | children () const |
DIE * | getParent () const |
DIEAbbrev | generateAbbrev () const |
Generate the abbreviation for this DIE. | |
void | setAbbrevNumber (unsigned I) |
Set the abbreviation number for this DIE. | |
uint64_t | getDebugSectionOffset () const |
Get the absolute offset within the .debug_info or .debug_types section for this DIE. | |
unsigned | computeOffsetsAndAbbrevs (const dwarf::FormParams &FormParams, DIEAbbrevSet &AbbrevSet, unsigned CUOffset) |
Compute the offset of this DIE and all its children. | |
const DIE * | getUnitDie () const |
Climb up the parent chain to get the compile unit or type unit DIE that this DIE belongs to. | |
DIEUnit * | getUnit () const |
Climb up the parent chain to get the compile unit or type 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) |
DIEValue | findAttribute (dwarf::Attribute Attribute) const |
Find a value in the DIE with the attribute given. | |
void | print (raw_ostream &O, unsigned IndentCount=0) const |
void | dump () const |
![]() | |
value_iterator | addValue (BumpPtrAllocator &Alloc, const DIEValue &V) |
template<class T > | |
value_iterator | addValue (BumpPtrAllocator &Alloc, dwarf::Attribute Attribute, dwarf::Form Form, T &&Value) |
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) |
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 861 of file DIE.h.
References assert(), and getParent().
Referenced by llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs(), llvm::DwarfCompileUnit::constructImportedEntityDIE(), llvm::DwarfCompileUnit::constructInlinedScopeDIE(), llvm::DwarfCompileUnit::constructScopeDIE(), llvm::DwarfCompileUnit::constructSubprogramScopeDIE(), llvm::DwarfUnit::createAndAddDIE(), and llvm::DwarfCompileUnit::createAndAddScopeChildren().
Definition at line 868 of file DIE.h.
References assert(), and getParent().
Referenced by llvm::DwarfCompileUnit::createBaseTypeDIEs().
|
inline |
Definition at line 802 of file DIE.h.
References llvm::make_range().
Referenced by computeOffsetsAndAbbrevs(), llvm::AsmPrinter::emitDwarfDIE(), and print().
|
inline |
Definition at line 805 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 270 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 265 of file DIE.cpp.
References llvm::dbgs(), and print().
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 214 of file DIE.cpp.
References llvm::DIEValueList::values().
Referenced by computeIndexValue().
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 178 of file DIE.cpp.
References llvm::DIEAbbrev::AddAttribute(), llvm::DIEAbbrev::AddImplicitConstAttribute(), hasChildren(), and llvm::DIEValueList::values().
Referenced by llvm::DIEAbbrevSet::uniqueAbbreviation().
|
inlinestatic |
Definition at line 776 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::DwarfUnit::createAndAddDIE(), and llvm::DwarfCompileUnit::createBaseTypeDIEs().
|
inline |
Definition at line 781 of file DIE.h.
Referenced by computeOffsetsAndAbbrevs(), and llvm::AsmPrinter::emitDwarfDIE().
uint64_t DIE::getDebugSectionOffset | ( | ) | const |
Get the absolute offset within the .debug_info or .debug_types section for this DIE.
Definition at line 189 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 784 of file DIE.h.
References assert(), and Offset.
Referenced by computeOffsetsAndAbbrevs(), llvm::AsmPrinter::emitDwarfDIE(), llvm::DIEEntry::emitValue(), llvm::CompileUnit::fixupForwardReferences(), getDebugSectionOffset(), llvm::DWARFUnit::getDIEIndexForOffset(), llvm::DWARF5AccelTableData::getDieOffset(), llvm::DWARF5AccelTableData::order(), llvm::AppleAccelTableOffsetData::order(), and llvm::DIEEntry::sizeOf().
DIE * DIE::getParent | ( | ) | const |
Definition at line 176 of file DIE.cpp.
Referenced by addChild(), addChildFront(), and llvm::DIEHash::computeTypeSignature().
|
inline |
Definition at line 789 of file DIE.h.
References assert(), and Size.
Referenced by llvm::DwarfStreamer::emitDIE(), llvm::AsmPrinter::emitDwarfDIE(), llvm::DwarfStreamer::emitPaperTrailWarningsDie(), and llvm::DwarfCompileUnit::getLength().
|
inline |
Definition at line 782 of file DIE.h.
Referenced by computeIndexValue(), llvm::DwarfUnit::constructTypeDIE(), llvm::AppleAccelTableTypeData::emit(), llvm::AsmPrinter::emitDwarfDIE(), llvm::DeclContextTree::getChildDeclContext(), llvm::DWARFContext::getDIEsForAddress(), llvm::DWARF5AccelTableData::getDieTag(), getNames(), llvm::DwarfUnit::getOrCreateStaticMemberDIE(), llvm::CompileUnit::markEverythingAsKept(), llvm::CompileUnit::noteRangeAttribute(), and print().
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 207 of file DIE.cpp.
References getUnitDie().
Referenced by llvm::DwarfUnit::addDIEEntry(), llvm::DwarfCompileUnit::constructSubprogramScopeDIE(), llvm::DIEEntry::emitValue(), getDebugSectionOffset(), llvm::DwarfUnit::getOrCreateSubprogramDIE(), llvm::DwarfUnit::getOrCreateTypeDIE(), and llvm::DwarfCompileUnit::updateSubprogramScopeDIE().
Climb up the parent chain to get the compile unit or type unit DIE that this DIE belongs to.
Definition at line 195 of file DIE.cpp.
Referenced by llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE(), and getUnit().
|
inline |
Definition at line 794 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 240 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 818 of file DIE.h.
References I.
Referenced by llvm::DIEAbbrevSet::uniqueAbbreviation().
|
inline |
|
inline |
|
inline |
|
friend |