LLVM  4.0.0
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::DIE Class Reference

A structured debug information entry. More...

#include <DIE.h>

Inheritance diagram for llvm::DIE:
[legend]
Collaboration diagram for llvm::DIE:
[legend]

Public Types

typedef IntrusiveBackList< DIE >
::iterator 
child_iterator
 
typedef IntrusiveBackList< DIE >
::const_iterator 
const_child_iterator
 
typedef iterator_range
< child_iterator
child_range
 
typedef iterator_range
< const_child_iterator
const_child_range
 
- Public Types inherited from llvm::DIEValueList
typedef iterator_range
< value_iterator
value_range
 
typedef iterator_range
< const_value_iterator
const_value_range
 

Public Member Functions

 DIE (const DIE &RHS)=delete
 
 DIE (DIE &&RHS)=delete
 
void operator= (const DIE &RHS)=delete
 
void 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
 
DIEgetParent () 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 DIEgetUnitDie () const
 Climb up the parent chain to get the compile unit or type unit DIE that this DIE belongs to. More...
 
const DIEUnitgetUnit () 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)
 
DIEaddChild (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 ()
 
- 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 DIEget (BumpPtrAllocator &Alloc, dwarf::Tag Tag)
 

Friends

class IntrusiveBackList< DIE >
 
class DIEUnit
 

Detailed Description

A structured debug information entry.

Has an abbreviation which describes its organization.

Definition at line 655 of file DIE.h.

Member Typedef Documentation

Definition at line 699 of file DIE.h.

Definition at line 701 of file DIE.h.

Definition at line 700 of file DIE.h.

Definition at line 702 of file DIE.h.

Constructor & Destructor Documentation

llvm::DIE::DIE ( const DIE RHS)
delete
llvm::DIE::DIE ( DIE &&  RHS)
delete

Member Function Documentation

DIE& llvm::DIE::addChild ( DIE Child)
inline
child_range llvm::DIE::children ( )
inline

Definition at line 704 of file DIE.h.

References llvm::make_range().

Referenced by computeOffsetsAndAbbrevs(), llvm::AsmPrinter::emitDwarfDIE(), and print().

const_child_range llvm::DIE::children ( ) const
inline

Definition at line 707 of file DIE.h.

References 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.

Parameters
APAsmPrinter to use when calculating sizes.
AbbrevSetthe abbreviation used to unique DIE abbreviations.
CUOffsetthe compile/type unit relative offset in bytes.
Returns
the offset for the DIE that follows this DIE within the current compile/type unit.

Definition at line 257 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 ( )

Definition at line 253 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 202 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 167 of file DIE.cpp.

References llvm::DIEAbbrev::AddAttribute(), llvm::DIEAbbrev::AddImplicitConstAttribute(), hasChildren(), and llvm::DIEValueList::values().

Referenced by llvm::DIEAbbrevSet::uniqueAbbreviation().

static DIE* llvm::DIE::get ( BumpPtrAllocator Alloc,
dwarf::Tag  Tag 
)
inlinestatic
unsigned llvm::DIE::getAbbrevNumber ( ) const
inline

Definition at line 691 of file DIE.h.

Referenced by computeOffsetsAndAbbrevs(), and 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 178 of file DIE.cpp.

References assert(), llvm::DIEUnit::getDebugSectionOffset(), getOffset(), and getUnit().

Referenced by llvm::DIEEntry::EmitValue().

unsigned llvm::DIE::getOffset ( ) const
inline
DIE * DIE::getParent ( ) const

Definition at line 163 of file DIE.cpp.

Referenced by addChild(), llvm::DIEHash::computeTypeSignature(), and getUnitDie().

unsigned llvm::DIE::getSize ( ) const
inline

Definition at line 695 of file DIE.h.

Referenced by llvm::AsmPrinter::emitDwarfDIE(), and llvm::DwarfCompileUnit::getLength().

dwarf::Tag llvm::DIE::getTag ( ) const
inline
const DIEUnit * DIE::getUnit ( ) const

Climb up the parent chain to get the compile unit or type unit that this DIE belongs to.

Returns
the DIEUnit that represents the compile or type unit that owns this DIE, or NULL if this DIE hasn't been added to a unit DIE.

Definition at line 195 of file DIE.cpp.

References getUnitDie().

Referenced by llvm::DwarfUnit::addDIEEntry(), llvm::DIEEntry::EmitValue(), and getDebugSectionOffset().

const DIE * DIE::getUnitDie ( ) const

Climb up the parent chain to get the compile unit or type unit DIE that this DIE belongs to.

Returns
the compile or type unit DIE that owns this DIE, or NULL if this DIE hasn't been added to a unit DIE.

Definition at line 184 of file DIE.cpp.

References getParent(), and getTag().

Referenced by llvm::DwarfDebug::addDwarfTypeUnitType(), and getUnit().

bool llvm::DIE::hasChildren ( ) const
inline
void llvm::DIE::operator= ( const DIE RHS)
delete
void llvm::DIE::operator= ( const DIE &&  RHS)
delete
LLVM_DUMP_METHOD void DIE::print ( raw_ostream O,
unsigned  IndentCount = 0 
) const
void llvm::DIE::setAbbrevNumber ( unsigned  I)
inline

Set the abbreviation number for this DIE.

Definition at line 720 of file DIE.h.

References I.

Referenced by llvm::DIEAbbrevSet::uniqueAbbreviation().

void llvm::DIE::setForceChildren ( bool  B)
inline

Definition at line 697 of file DIE.h.

References B.

void llvm::DIE::setOffset ( unsigned  O)
inline

Definition at line 759 of file DIE.h.

References Offset.

Referenced by computeOffsetsAndAbbrevs().

void llvm::DIE::setSize ( unsigned  S)
inline

Definition at line 760 of file DIE.h.

Referenced by computeOffsetsAndAbbrevs().

Friends And Related Function Documentation

friend class DIEUnit
friend

Definition at line 657 of file DIE.h.

friend class IntrusiveBackList< DIE >
friend

Definition at line 656 of file DIE.h.


The documentation for this class was generated from the following files: