LLVM
8.0.1
|
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. More... | |
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. More... | |
void | setAbbrevNumber (unsigned I) |
Set the abbreviation number for this DIE. More... | |
unsigned | getDebugSectionOffset () const |
Get the absolute offset within the .debug_info or .debug_types section for this DIE. More... | |
unsigned | computeOffsetsAndAbbrevs (const AsmPrinter *AP, DIEAbbrevSet &AbbrevSet, unsigned CUOffset) |
Compute the offset of this DIE and all its children. More... | |
const DIE * | getUnitDie () const |
Climb up the parent chain to get the compile unit or type unit DIE that this DIE belongs to. More... | |
const DIEUnit * | getUnit () const |
Climb up the parent chain to get the compile unit or type unit that this DIE belongs to. More... | |
void | setOffset (unsigned O) |
void | setSize (unsigned S) |
DIE & | addChild (DIE *Child) |
Add a child to the DIE. More... | |
DIEValue | findAttribute (dwarf::Attribute Attribute) const |
Find a value in the DIE with the attribute given. More... | |
void | print (raw_ostream &O, unsigned IndentCount=0) const |
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) |
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 |
using llvm::DIE::const_child_iterator = IntrusiveBackList<DIE>::const_iterator |
|
delete |
|
delete |
Add a child to the DIE.
Definition at line 769 of file DIE.h.
References assert(), llvm::IntrusiveBackList< T >::back(), llvm::dump(), getParent(), llvm::RISCVFenceField::O, print(), and llvm::IntrusiveBackList< T >::push_back().
Referenced by llvm::DwarfCompileUnit::constructScopeDIE(), llvm::DwarfCompileUnit::constructSubprogramScopeDIE(), llvm::DwarfUnit::createAndAddDIE(), llvm::DwarfCompileUnit::createAndAddScopeChildren(), and llvm::DwarfDebug::shareAcrossDWOCUs().
|
inline |
Definition at line 710 of file DIE.h.
References llvm::IntrusiveBackList< T >::begin(), llvm::IntrusiveBackList< T >::end(), and llvm::make_range().
Referenced by llvm::DIEHash::addSLEB128(), llvm::DwarfDebug::beginModule(), and llvm::AsmPrinter::emitDwarfDIE().
|
inline |
Definition at line 713 of file DIE.h.
References llvm::IntrusiveBackList< T >::begin(), llvm::IntrusiveBackList< T >::end(), getParent(), and llvm::make_range().
unsigned DIE::computeOffsetsAndAbbrevs | ( | const AsmPrinter * | AP, |
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.
AP | AsmPrinter to use when calculating sizes. |
AbbrevSet | the abbreviation used to unique DIE abbreviations. |
CUOffset | the compile/type unit relative offset in bytes. |
Definition at line 278 of file DIE.cpp.
References assert(), llvm::children(), llvm::getOffset(), llvm::getULEB128Size(), llvm::DIEAbbrev::hasChildren(), llvm::DIEAbbrevSet::uniqueAbbreviation(), and llvm::cl::values().
Referenced by llvm::DwarfFile::computeSizeAndOffset().
LLVM_DUMP_METHOD void DIE::dump | ( | ) | const |
Definition at line 273 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 222 of file DIE.cpp.
References LLVM_DUMP_METHOD, and llvm::cl::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 187 of file DIE.cpp.
References llvm::DIEAbbrev::AddAttribute(), llvm::DIEAbbrev::AddImplicitConstAttribute(), llvm::Tag, and llvm::cl::values().
Referenced by llvm::DIEAbbrevSet::uniqueAbbreviation().
|
inlinestatic |
Definition at line 692 of file DIE.h.
Referenced by llvm::DwarfCompileUnit::constructImportedEntityDIE(), llvm::DwarfCompileUnit::constructInlinedScopeDIE(), llvm::DwarfCompileUnit::constructLabelDIE(), llvm::DwarfCompileUnit::constructLexicalScopeDIE(), llvm::DwarfCompileUnit::constructSubprogramScopeDIE(), and llvm::DwarfUnit::createAndAddDIE().
|
inline |
Definition at line 697 of file DIE.h.
Referenced by llvm::AsmPrinter::emitDwarfDIE().
unsigned DIE::getDebugSectionOffset | ( | ) | const |
Get the absolute offset within the .debug_info or .debug_types section for this DIE.
Definition at line 198 of file DIE.cpp.
References assert(), llvm::DIEUnit::getDebugSectionOffset(), llvm::getOffset(), and Unit.
|
inline |
Get the compile/type unit relative offset of this DIE.
Definition at line 700 of file DIE.h.
Referenced by computeIndexValue(), llvm::AsmPrinter::emitDwarfDIE(), llvm::DwarfTypeUnit::emitHeader(), and llvm::DWARF5AccelTableData::order().
DIE * DIE::getParent | ( | ) | const |
Definition at line 183 of file DIE.cpp.
Referenced by addChild(), llvm::DIEHash::addSLEB128(), llvm::DIEHash::computeTypeSignature(), and getUnitDie().
|
inline |
Definition at line 701 of file DIE.h.
References Size.
Referenced by llvm::AsmPrinter::emitDwarfDIE(), and llvm::DwarfCompileUnit::getLength().
|
inline |
Definition at line 698 of file DIE.h.
References llvm::Tag.
Referenced by llvm::DIEHash::addSLEB128(), computeIndexValue(), llvm::DwarfUnit::constructTypeDIE(), llvm::AsmPrinter::emitDwarfDIE(), llvm::DwarfUnit::getOrCreateStaticMemberDIE(), llvm::DwarfUnit::getOrCreateTypeDIE(), llvm::DwarfUnit::getParentContextString(), and getUnitDie().
Climb up the parent chain to get the compile unit or type unit that this DIE belongs to.
Definition at line 215 of file DIE.cpp.
Referenced by llvm::DwarfUnit::addDIEEntry().
Climb up the parent chain to get the compile unit or type unit DIE that this DIE belongs to.
Definition at line 204 of file DIE.cpp.
References getParent(), and getTag().
Referenced by llvm::DwarfDebug::addDwarfTypeUnitType(), llvm::DwarfDebug::beginModule(), and llvm::emitDWARF5AccelTable().
|
inline |
Definition at line 702 of file DIE.h.
References llvm::IntrusiveBackListBase::empty().
Referenced by llvm::AsmPrinter::emitDwarfDIE(), and llvm::DwarfUnit::hasContent().
LLVM_DUMP_METHOD void DIE::print | ( | raw_ostream & | O, |
unsigned | IndentCount = 0 |
||
) | const |
Definition at line 248 of file DIE.cpp.
References llvm::dwarf::AttributeString(), llvm::children(), llvm::dwarf::ChildrenString(), llvm::format(), llvm::dwarf::FormEncodingString(), getTag(), Indent, Size, llvm::dwarf::TagString(), and llvm::cl::values().
|
inline |
Set the abbreviation number for this DIE.
Definition at line 726 of file DIE.h.
References I.
Referenced by llvm::DIEAbbrevSet::uniqueAbbreviation().
|
inline |
|
inline |
Definition at line 765 of file DIE.h.
References llvm::RISCVFenceField::O.
|
friend |