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

DIE - 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
 
typedef DIEValueList::iterator value_iterator
 
typedef iterator_range
< value_iterator
value_range
 
typedef
DIEValueList::const_iterator 
const_value_iterator
 
typedef iterator_range
< const_value_iterator
const_value_range
 

Public Member Functions

unsigned getAbbrevNumber () const
 
dwarf::Tag getTag () const
 
unsigned getOffset () const
 
unsigned getSize () const
 
bool hasChildren () const
 
child_range children ()
 
const_child_range children () const
 
value_range values ()
 
const_value_range values () 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...
 
const DIEgetUnit () const
 Climb up the parent chain to get the compile or type unit DIE this DIE belongs to. More...
 
const DIEgetUnitOrNull () const
 Similar to getUnit, returns null when DIE is not added to an owner yet. More...
 
void setOffset (unsigned O)
 
void setSize (unsigned S)
 
value_iterator addValue (BumpPtrAllocator &Alloc, DIEValue Value)
 addValue - Add a value and attributes to a DIE. More...
 
template<class T >
value_iterator addValue (BumpPtrAllocator &Alloc, dwarf::Attribute Attribute, dwarf::Form Form, T &&Value)
 
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 ()
 

Static Public Member Functions

static DIEget (BumpPtrAllocator &Alloc, dwarf::Tag Tag)
 

Protected Member Functions

 DIE ()
 

Protected Attributes

unsigned Offset
 Offset - Offset in debug info section. More...
 
unsigned Size
 Size - Size of instance + children. More...
 
unsigned AbbrevNumber = ~0u
 
dwarf::Tag Tag = (dwarf::Tag)0
 Tag - Dwarf tag code. More...
 
IntrusiveBackList< DIEChildren
 Children DIEs. More...
 
DIEParent = nullptr
 
DIEValueList Values
 Attribute values. More...
 

Friends

class IntrusiveBackList< DIE >
 

Detailed Description

DIE - A structured debug information entry.

Has an abbreviation which describes its organization.

Definition at line 623 of file DIE.h.

Member Typedef Documentation

Definition at line 668 of file DIE.h.

Definition at line 670 of file DIE.h.

Definition at line 669 of file DIE.h.

Definition at line 671 of file DIE.h.

Definition at line 687 of file DIE.h.

Definition at line 688 of file DIE.h.

Definition at line 680 of file DIE.h.

Definition at line 681 of file DIE.h.

Constructor & Destructor Documentation

llvm::DIE::DIE ( )
inlineprotected

Definition at line 651 of file DIE.h.

Referenced by get().

Member Function Documentation

DIE& llvm::DIE::addChild ( DIE Child)
inline
value_iterator llvm::DIE::addValue ( BumpPtrAllocator Alloc,
DIEValue  Value 
)
inline
template<class T >
value_iterator llvm::DIE::addValue ( BumpPtrAllocator Alloc,
dwarf::Attribute  Attribute,
dwarf::Form  Form,
T &&  Value 
)
inline

Definition at line 720 of file DIE.h.

References llvm::DIEValueList::emplace(), and Values.

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

Definition at line 676 of file DIE.h.

References Children, and llvm::make_range().

void DIE::dump ( )

Definition at line 189 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 138 of file DIE.cpp.

References 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 110 of file DIE.cpp.

References llvm::DIEAbbrev::AddAttribute(), hasChildren(), Tag, and Values.

Referenced by llvm::DwarfFile::assignAbbrevNumber().

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

Definition at line 662 of file DIE.h.

References AbbrevNumber.

Referenced by llvm::DwarfFile::computeSizeAndOffset(), and llvm::AsmPrinter::emitDwarfDIE().

unsigned llvm::DIE::getOffset ( ) const
inline
DIE* llvm::DIE::getParent ( ) const
inline
unsigned llvm::DIE::getSize ( ) const
inline
dwarf::Tag llvm::DIE::getTag ( ) const
inline
const DIE * DIE::getUnit ( ) const

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

Climb up the parent chain to get the unit DIE to which this DIE belongs.

Definition at line 119 of file DIE.cpp.

References getUnitOrNull().

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

const DIE * DIE::getUnitOrNull ( ) const

Similar to getUnit, returns null when DIE is not added to an owner yet.

Climb up the parent chain to get the unit DIE this DIE belongs to.

Return NULL if DIE is not added to an owner yet.

Definition at line 127 of file DIE.cpp.

References getParent(), and getTag().

Referenced by llvm::DwarfUnit::addDIEEntry(), and getUnit().

bool llvm::DIE::hasChildren ( ) const
inline
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 703 of file DIE.h.

References AbbrevNumber, and I.

Referenced by llvm::DwarfFile::assignAbbrevNumber().

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

Definition at line 711 of file DIE.h.

References Offset.

Referenced by llvm::DwarfFile::computeSizeAndOffset().

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

Definition at line 712 of file DIE.h.

References Size.

Referenced by llvm::DwarfFile::computeSizeAndOffset().

value_range llvm::DIE::values ( )
inline
const_value_range llvm::DIE::values ( ) const
inline

Friends And Related Function Documentation

friend class IntrusiveBackList< DIE >
friend

Definition at line 624 of file DIE.h.

Member Data Documentation

unsigned llvm::DIE::AbbrevNumber = ~0u
protected

Definition at line 635 of file DIE.h.

Referenced by getAbbrevNumber(), and setAbbrevNumber().

IntrusiveBackList<DIE> llvm::DIE::Children
protected

Children DIEs.

Definition at line 642 of file DIE.h.

Referenced by addChild(), children(), and hasChildren().

unsigned llvm::DIE::Offset
protected

Offset - Offset in debug info section.

Definition at line 629 of file DIE.h.

Referenced by getOffset(), print(), and setOffset().

DIE* llvm::DIE::Parent = nullptr
protected

Definition at line 644 of file DIE.h.

Referenced by addChild(), and getParent().

unsigned llvm::DIE::Size
protected

Size - Size of instance + children.

Definition at line 633 of file DIE.h.

Referenced by getSize(), print(), and setSize().

dwarf::Tag llvm::DIE::Tag = (dwarf::Tag)0
protected

Tag - Dwarf tag code.

Definition at line 639 of file DIE.h.

Referenced by generateAbbrev(), get(), and getTag().

DIEValueList llvm::DIE::Values
protected

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