LLVM  8.0.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::DwarfUnit Class Referenceabstract

This dwarf writer support class manages information associated with a source file. More...

#include "CodeGen/AsmPrinter/DwarfUnit.h"

Inheritance diagram for llvm::DwarfUnit:
Inheritance graph
[legend]
Collaboration diagram for llvm::DwarfUnit:
Collaboration graph
[legend]

Public Member Functions

AsmPrintergetAsmPrinter () const
 
MCSymbolgetEndLabel () const
 
uint16_t getLanguage () const
 
const DICompileUnitgetCUNode () const
 
uint16_t getDwarfVersion () const
 
bool hasContent () const
 Return true if this compile unit has something to write out. More...
 
std::string getParentContextString (const DIScope *Context) const
 Get string containing language specific context for a global name. More...
 
virtual void addGlobalName (StringRef Name, const DIE &Die, const DIScope *Context)=0
 Add a new global name to the compile unit. More...
 
virtual void addGlobalType (const DIType *Ty, const DIE &Die, const DIScope *Context)=0
 Add a new global type to the compile unit. More...
 
DIEgetDIE (const DINode *D) const
 Returns the DIE map slot for the specified debug variable. More...
 
DIELocgetDIELoc ()
 Returns a fresh newly allocated DIELoc. More...
 
void insertDIE (const DINode *Desc, DIE *D)
 Insert DIE into the map. More...
 
void addFlag (DIE &Die, dwarf::Attribute Attribute)
 Add a flag that is true to the DIE. More...
 
void addUInt (DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, uint64_t Integer)
 Add an unsigned integer attribute data and value. More...
 
void addUInt (DIEValueList &Block, dwarf::Form Form, uint64_t Integer)
 
void addSInt (DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, int64_t Integer)
 Add an signed integer attribute data and value. More...
 
void addSInt (DIELoc &Die, Optional< dwarf::Form > Form, int64_t Integer)
 
void addString (DIE &Die, dwarf::Attribute Attribute, StringRef Str)
 Add a string attribute data and value. More...
 
DIEValueList::value_iterator addLabel (DIEValueList &Die, dwarf::Attribute Attribute, dwarf::Form Form, const MCSymbol *Label)
 Add a Dwarf label attribute data and value. More...
 
void addLabel (DIELoc &Die, dwarf::Form Form, const MCSymbol *Label)
 
void addSectionOffset (DIE &Die, dwarf::Attribute Attribute, uint64_t Integer)
 Add an offset into a section attribute data and value. More...
 
void addOpAddress (DIELoc &Die, const MCSymbol *Sym)
 Add a dwarf op address data and value using the form given and an op of either DW_FORM_addr or DW_FORM_GNU_addr_index. More...
 
void addLabelDelta (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
 Add a label delta attribute data and value. More...
 
void addDIEEntry (DIE &Die, dwarf::Attribute Attribute, DIE &Entry)
 Add a DIE attribute data and value. More...
 
void addDIEEntry (DIE &Die, dwarf::Attribute Attribute, DIEEntry Entry)
 Add a DIE attribute data and value. More...
 
void addDIETypeSignature (DIE &Die, uint64_t Signature)
 Add a type's DW_AT_signature and set the declaration flag. More...
 
void addBlock (DIE &Die, dwarf::Attribute Attribute, DIELoc *Loc)
 Add block data. More...
 
void addBlock (DIE &Die, dwarf::Attribute Attribute, DIEBlock *Block)
 Add block data. More...
 
void addSourceLine (DIE &Die, unsigned Line, const DIFile *File)
 Add location information to specified debug information entry. More...
 
void addSourceLine (DIE &Die, const DILocalVariable *V)
 
void addSourceLine (DIE &Die, const DIGlobalVariable *G)
 
void addSourceLine (DIE &Die, const DISubprogram *SP)
 
void addSourceLine (DIE &Die, const DILabel *L)
 
void addSourceLine (DIE &Die, const DIType *Ty)
 
void addSourceLine (DIE &Die, const DIObjCProperty *Ty)
 
void addConstantValue (DIE &Die, const MachineOperand &MO, const DIType *Ty)
 Add constant value entry in variable DIE. More...
 
void addConstantValue (DIE &Die, const ConstantInt *CI, const DIType *Ty)
 
void addConstantValue (DIE &Die, const APInt &Val, const DIType *Ty)
 
void addConstantValue (DIE &Die, const APInt &Val, bool Unsigned)
 
void addConstantValue (DIE &Die, bool Unsigned, uint64_t Val)
 
void addConstantFPValue (DIE &Die, const MachineOperand &MO)
 Add constant value entry in variable DIE. More...
 
void addConstantFPValue (DIE &Die, const ConstantFP *CFP)
 
void addLinkageName (DIE &Die, StringRef LinkageName)
 Add a linkage name, if it isn't empty. More...
 
void addTemplateParams (DIE &Buffer, DINodeArray TParams)
 Add template parameters in buffer. More...
 
void addThrownTypes (DIE &Die, DINodeArray ThrownTypes)
 Add thrown types. More...
 
void addBlockByrefAddress (const DbgVariable &DV, DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
 Start with the address based on the location provided, and generate the DWARF information necessary to find the actual Block variable (navigating the Block struct) based on the starting location. More...
 
void addType (DIE &Entity, const DIType *Ty, dwarf::Attribute Attribute=dwarf::DW_AT_type)
 Add a new type attribute to the specified entity. More...
 
DIEgetOrCreateNameSpace (const DINamespace *NS)
 
DIEgetOrCreateModule (const DIModule *M)
 
DIEgetOrCreateSubprogramDIE (const DISubprogram *SP, bool Minimal=false)
 
void applySubprogramAttributes (const DISubprogram *SP, DIE &SPDie, bool SkipSPAttributes=false)
 
DIEgetOrCreateTypeDIE (const MDNode *TyNode)
 Find existing DIE or create new DIE for the given type. More...
 
DIEgetOrCreateContextDIE (const DIScope *Context)
 Get context owner's DIE. More...
 
void constructContainingTypeDIEs ()
 Construct DIEs for types that contain vtables. More...
 
void constructSubprogramArguments (DIE &Buffer, DITypeRefArray Args)
 Construct function argument DIEs. More...
 
DIEcreateAndAddDIE (unsigned Tag, DIE &Parent, const DINode *N=nullptr)
 Create a DIE with the given Tag, add the DIE to its parent, and call insertDIE if MD is not null. More...
 
bool useSegmentedStringOffsetsTable () const
 
virtual unsigned getHeaderSize () const
 Compute the size of a header for this unit, not including the initial length field. More...
 
virtual void emitHeader (bool UseOffsets)=0
 Emit the header for this unit, not including the initial length field. More...
 
void addStringOffsetsStart ()
 Add the DW_AT_str_offsets_base attribute to the unit DIE. More...
 
void addRnglistsBase ()
 Add the DW_AT_rnglists_base attribute to the unit DIE. More...
 
void addLoclistsBase ()
 Add the DW_AT_loclists_base attribute to the unit DIE. More...
 
virtual DwarfCompileUnitgetCU ()=0
 
void constructTypeDIE (DIE &Buffer, const DICompositeType *CTy)
 
DIE::value_iterator addSectionDelta (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
 addSectionDelta - Add a label delta attribute data and value. More...
 
DIE::value_iterator addSectionLabel (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label, const MCSymbol *Sec)
 Add a Dwarf section label attribute data and value. More...
 
MD5::MD5ResultgetMD5AsBytes (const DIFile *File) const
 If the File has an MD5 checksum, return it as an MD5Result allocated in the MCContext. More...
 
- Public Member Functions inherited from llvm::DIEUnit
 DIEUnit (uint16_t Version, uint8_t AddrSize, dwarf::Tag UnitTag)
 
 DIEUnit (const DIEUnit &RHS)=delete
 
 DIEUnit (DIEUnit &&RHS)=delete
 
void operator= (const DIEUnit &RHS)=delete
 
void operator= (const DIEUnit &&RHS)=delete
 
void setSection (MCSection *Section)
 Set the section that this DIEUnit will be emitted into. More...
 
MCSectiongetSection () const
 Return the section that this DIEUnit will be emitted into. More...
 
void setDebugSectionOffset (unsigned O)
 
unsigned getDebugSectionOffset () const
 
void setLength (uint64_t L)
 
uint64_t getLength () const
 
uint16_t getDwarfVersion () const
 
uint16_t getAddressSize () const
 
DIEgetUnitDie ()
 
const DIEgetUnitDie () const
 

Protected Member Functions

 DwarfUnit (dwarf::Tag, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
 
bool applySubprogramDefinitionAttributes (const DISubprogram *SP, DIE &SPDie)
 
bool shareAcrossDWOCUs () const
 
bool isShareableAcrossCUs (const DINode *D) const
 Check whether the DIE for this MDNode can be shared across CUs. More...
 
 ~DwarfUnit ()
 
DIEgetOrCreateStaticMemberDIE (const DIDerivedType *DT)
 Create new static data member DIE. More...
 
virtual unsigned getOrCreateSourceID (const DIFile *File)=0
 Look up the source ID for the given file. More...
 
template<typename T >
Tresolve (TypedDINodeRef< T > Ref) const
 Look in the DwarfDebug map for the MDNode that corresponds to the reference. More...
 
void updateAcceleratorTables (const DIScope *Context, const DIType *Ty, const DIE &TyDIE)
 If this is a named finished type then include it in the list of types for the accelerator tables. More...
 
void emitCommonHeader (bool UseOffsets, dwarf::UnitType UT)
 Emit the common part of the header for this unit. More...
 
- Protected Member Functions inherited from llvm::DIEUnit
 ~DIEUnit ()=default
 The size in bytes of an address for this unit. More...
 

Protected Attributes

const DICompileUnitCUNode
 MDNode for the compile unit. More...
 
BumpPtrAllocator DIEValueAllocator
 
AsmPrinterAsm
 Target of Dwarf emission. More...
 
MCSymbolEndLabel = nullptr
 Emitted at the end of the CU and used to compute the CU Length field. More...
 
DwarfDebugDD
 
DwarfFileDU
 
DIEIndexTyDie
 An anonymous type for index type. Owned by DIEUnit. More...
 
DenseMap< const MDNode *, DIE * > MDNodeToDieMap
 Tracks the mapping of unit level debug information variables to debug information entries. More...
 
std::vector< DIEBlock * > DIEBlocks
 A list of all the DIEBlocks in use. More...
 
std::vector< DIELoc * > DIELocs
 A list of all the DIELocs in use. More...
 
DenseMap< DIE *, const DINode * > ContainingTypeMap
 This map is used to keep track of subprogram DIEs that need DW_AT_containing_type attribute. More...
 

Detailed Description

This dwarf writer support class manages information associated with a source file.

Definition at line 41 of file DwarfUnit.h.

Constructor & Destructor Documentation

◆ DwarfUnit()

DwarfUnit::DwarfUnit ( dwarf::Tag  UnitTag,
const DICompileUnit Node,
AsmPrinter A,
DwarfDebug DW,
DwarfFile DWU 
)
protected

Definition at line 72 of file DwarfUnit.cpp.

◆ ~DwarfUnit()

DwarfUnit::~DwarfUnit ( )
protected

Definition at line 85 of file DwarfUnit.cpp.

References DD, DIEBlocks, DIELocs, llvm::DwarfDebug::getDwarfVersion(), and getLanguage().

Referenced by getHeaderSize().

Member Function Documentation

◆ addBlock() [1/2]

void DwarfUnit::addBlock ( DIE Die,
dwarf::Attribute  Attribute,
DIELoc Loc 
)

◆ addBlock() [2/2]

void DwarfUnit::addBlock ( DIE Die,
dwarf::Attribute  Attribute,
DIEBlock Block 
)

◆ addBlockByrefAddress()

void llvm::DwarfUnit::addBlockByrefAddress ( const DbgVariable DV,
DIE Die,
dwarf::Attribute  Attribute,
const MachineLocation Location 
)

Start with the address based on the location provided, and generate the DWARF information necessary to find the actual Block variable (navigating the Block struct) based on the starting location.

Add the DWARF information to the die. Obsolete, please use addComplexAddress instead.

Referenced by getDIELoc().

◆ addConstantFPValue() [1/2]

void DwarfUnit::addConstantFPValue ( DIE Die,
const MachineOperand MO 
)

◆ addConstantFPValue() [2/2]

void DwarfUnit::addConstantFPValue ( DIE Die,
const ConstantFP CFP 
)

◆ addConstantValue() [1/5]

void DwarfUnit::addConstantValue ( DIE Die,
const MachineOperand MO,
const DIType Ty 
)

◆ addConstantValue() [2/5]

void DwarfUnit::addConstantValue ( DIE Die,
const ConstantInt CI,
const DIType Ty 
)

Definition at line 514 of file DwarfUnit.cpp.

References addConstantValue(), and llvm::ConstantInt::getValue().

◆ addConstantValue() [3/5]

void DwarfUnit::addConstantValue ( DIE Die,
const APInt Val,
const DIType Ty 
)

Definition at line 533 of file DwarfUnit.cpp.

References addConstantValue(), DD, and isUnsignedDIType().

◆ addConstantValue() [4/5]

void DwarfUnit::addConstantValue ( DIE Die,
const APInt Val,
bool  Unsigned 
)

◆ addConstantValue() [5/5]

void DwarfUnit::addConstantValue ( DIE Die,
bool  Unsigned,
uint64_t  Val 
)

Definition at line 526 of file DwarfUnit.cpp.

References addUInt().

◆ addDIEEntry() [1/2]

void DwarfUnit::addDIEEntry ( DIE Die,
dwarf::Attribute  Attribute,
DIE Entry 
)

◆ addDIEEntry() [2/2]

void DwarfUnit::addDIEEntry ( DIE Die,
dwarf::Attribute  Attribute,
DIEEntry  Entry 
)

◆ addDIETypeSignature()

void DwarfUnit::addDIETypeSignature ( DIE Die,
uint64_t  Signature 
)

Add a type's DW_AT_signature and set the declaration flag.

Definition at line 345 of file DwarfUnit.cpp.

References addFlag(), llvm::DIEValueList::addValue(), and DIEValueAllocator.

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

◆ addFlag()

void DwarfUnit::addFlag ( DIE Die,
dwarf::Attribute  Attribute 
)

◆ addGlobalName()

virtual void llvm::DwarfUnit::addGlobalName ( StringRef  Name,
const DIE Die,
const DIScope Context 
)
pure virtual

Add a new global name to the compile unit.

Implemented in llvm::DwarfTypeUnit, and llvm::DwarfCompileUnit.

Referenced by llvm::DwarfTypeUnit::getHeaderSize(), and hasContent().

◆ addGlobalType()

virtual void llvm::DwarfUnit::addGlobalType ( const DIType Ty,
const DIE Die,
const DIScope Context 
)
pure virtual

Add a new global type to the compile unit.

Implemented in llvm::DwarfTypeUnit, and llvm::DwarfCompileUnit.

Referenced by llvm::DwarfTypeUnit::getHeaderSize(), and hasContent().

◆ addLabel() [1/2]

DIEValueList::value_iterator DwarfUnit::addLabel ( DIEValueList Die,
dwarf::Attribute  Attribute,
dwarf::Form  Form,
const MCSymbol Label 
)

Add a Dwarf label attribute data and value.

Definition at line 269 of file DwarfUnit.cpp.

References llvm::DIEValueList::addValue(), and DIEValueAllocator.

Referenced by addLabel(), addOpAddress(), addSectionLabel(), and getDIELoc().

◆ addLabel() [2/2]

void DwarfUnit::addLabel ( DIELoc Die,
dwarf::Form  Form,
const MCSymbol Label 
)

Definition at line 276 of file DwarfUnit.cpp.

References addLabel().

◆ addLabelDelta()

void DwarfUnit::addLabelDelta ( DIE Die,
dwarf::Attribute  Attribute,
const MCSymbol Hi,
const MCSymbol Lo 
)

Add a label delta attribute data and value.

Definition at line 335 of file DwarfUnit.cpp.

References llvm::DIEValueList::addValue(), and DIEValueAllocator.

Referenced by getDIELoc().

◆ addLinkageName()

void DwarfUnit::addLinkageName ( DIE Die,
StringRef  LinkageName 
)

◆ addLoclistsBase()

void DwarfUnit::addLoclistsBase ( )

◆ addOpAddress()

void DwarfUnit::addOpAddress ( DIELoc Die,
const MCSymbol Sym 
)

Add a dwarf op address data and value using the form given and an op of either DW_FORM_addr or DW_FORM_GNU_addr_index.

Definition at line 317 of file DwarfUnit.cpp.

References addLabel(), addUInt(), DD, llvm::DwarfDebug::getAddressPool(), llvm::DwarfDebug::getDwarfVersion(), llvm::AddressPool::getIndex(), and llvm::DwarfDebug::useSplitDwarf().

Referenced by llvm::DwarfCompileUnit::constructLabelDIE(), constructTypeDIE(), getDIELoc(), and llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE().

◆ addRnglistsBase()

void DwarfUnit::addRnglistsBase ( )

◆ addSectionDelta()

DIE::value_iterator DwarfUnit::addSectionDelta ( DIE Die,
dwarf::Attribute  Attribute,
const MCSymbol Hi,
const MCSymbol Lo 
)

addSectionDelta - Add a label delta attribute data and value.

Definition at line 1607 of file DwarfUnit.cpp.

References llvm::DIEValueList::addValue(), DD, DIEValueAllocator, and llvm::DwarfDebug::getDwarfVersion().

Referenced by llvm::DwarfCompileUnit::addScopeRangeList(), addSectionLabel(), and getHeaderSize().

◆ addSectionLabel()

DIE::value_iterator DwarfUnit::addSectionLabel ( DIE Die,
dwarf::Attribute  Attribute,
const MCSymbol Label,
const MCSymbol Sec 
)

◆ addSectionOffset()

void DwarfUnit::addSectionOffset ( DIE Die,
dwarf::Attribute  Attribute,
uint64_t  Integer 
)

Add an offset into a section attribute data and value.

Definition at line 280 of file DwarfUnit.cpp.

References addUInt(), DD, and llvm::DwarfDebug::getDwarfVersion().

Referenced by getDIELoc(), and getMD5AsBytes().

◆ addSInt() [1/2]

void DwarfUnit::addSInt ( DIEValueList Die,
dwarf::Attribute  Attribute,
Optional< dwarf::Form Form,
int64_t  Integer 
)

Add an signed integer attribute data and value.

Definition at line 223 of file DwarfUnit.cpp.

References llvm::DIEValueList::addValue(), llvm::DIEInteger::BestForm(), and DIEValueAllocator.

Referenced by addSInt(), constructTypeDIE(), llvm::DIEDwarfExpression::DIEDwarfExpression(), and getDIELoc().

◆ addSInt() [2/2]

void DwarfUnit::addSInt ( DIELoc Die,
Optional< dwarf::Form Form,
int64_t  Integer 
)

Definition at line 230 of file DwarfUnit.cpp.

References addSInt().

◆ addSourceLine() [1/7]

void DwarfUnit::addSourceLine ( DIE Die,
unsigned  Line,
const DIFile File 
)

◆ addSourceLine() [2/7]

void DwarfUnit::addSourceLine ( DIE Die,
const DILocalVariable V 
)

◆ addSourceLine() [3/7]

void DwarfUnit::addSourceLine ( DIE Die,
const DIGlobalVariable G 
)

◆ addSourceLine() [4/7]

void DwarfUnit::addSourceLine ( DIE Die,
const DISubprogram SP 
)

Definition at line 413 of file DwarfUnit.cpp.

References addSourceLine(), assert(), and llvm::DIScope::getFile().

◆ addSourceLine() [5/7]

void DwarfUnit::addSourceLine ( DIE Die,
const DILabel L 
)

◆ addSourceLine() [6/7]

void DwarfUnit::addSourceLine ( DIE Die,
const DIType Ty 
)

◆ addSourceLine() [7/7]

void DwarfUnit::addSourceLine ( DIE Die,
const DIObjCProperty Ty 
)

◆ addString()

void DwarfUnit::addString ( DIE Die,
dwarf::Attribute  Attribute,
StringRef  Str 
)

◆ addStringOffsetsStart()

void DwarfUnit::addStringOffsetsStart ( )

◆ addTemplateParams()

void DwarfUnit::addTemplateParams ( DIE Buffer,
DINodeArray  TParams 
)

Add template parameters in buffer.

Definition at line 574 of file DwarfUnit.cpp.

Referenced by applySubprogramDefinitionAttributes(), constructTypeDIE(), getDIELoc(), and llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE().

◆ addThrownTypes()

void DwarfUnit::addThrownTypes ( DIE Die,
DINodeArray  ThrownTypes 
)

Add thrown types.

Definition at line 585 of file DwarfUnit.cpp.

References addType(), and createAndAddDIE().

Referenced by applySubprogramAttributes(), and getDIELoc().

◆ addType()

void DwarfUnit::addType ( DIE Entity,
const DIType Ty,
dwarf::Attribute  Attribute = dwarf::DW_AT_type 
)

◆ addUInt() [1/2]

void DwarfUnit::addUInt ( DIEValueList Die,
dwarf::Attribute  Attribute,
Optional< dwarf::Form Form,
uint64_t  Integer 
)

◆ addUInt() [2/2]

void DwarfUnit::addUInt ( DIEValueList Block,
dwarf::Form  Form,
uint64_t  Integer 
)

Definition at line 218 of file DwarfUnit.cpp.

References addUInt().

◆ applySubprogramAttributes()

void DwarfUnit::applySubprogramAttributes ( const DISubprogram SP,
DIE SPDie,
bool  SkipSPAttributes = false 
)

◆ applySubprogramDefinitionAttributes()

bool DwarfUnit::applySubprogramDefinitionAttributes ( const DISubprogram SP,
DIE SPDie 
)
protected

◆ constructContainingTypeDIEs()

void DwarfUnit::constructContainingTypeDIEs ( )

◆ constructSubprogramArguments()

void DwarfUnit::constructSubprogramArguments ( DIE Buffer,
DITypeRefArray  Args 
)

◆ constructTypeDIE()

void DwarfUnit::constructTypeDIE ( DIE Buffer,
const DICompositeType CTy 
)

◆ createAndAddDIE()

DIE & DwarfUnit::createAndAddDIE ( unsigned  Tag,
DIE Parent,
const DINode N = nullptr 
)

◆ emitCommonHeader()

void DwarfUnit::emitCommonHeader ( bool  UseOffsets,
dwarf::UnitType  UT 
)
protected

◆ emitHeader()

virtual void llvm::DwarfUnit::emitHeader ( bool  UseOffsets)
pure virtual

Emit the header for this unit, not including the initial length field.

Implemented in llvm::DwarfTypeUnit, and llvm::DwarfCompileUnit.

Referenced by llvm::DwarfFile::emitUnit(), getHeaderSize(), and llvm::DwarfTypeUnit::setType().

◆ getAsmPrinter()

AsmPrinter* llvm::DwarfUnit::getAsmPrinter ( ) const
inline

Definition at line 87 of file DwarfUnit.h.

References Asm.

◆ getCU()

virtual DwarfCompileUnit& llvm::DwarfUnit::getCU ( )
pure virtual

Implemented in llvm::DwarfTypeUnit, and llvm::DwarfCompileUnit.

Referenced by getHeaderSize().

◆ getCUNode()

const DICompileUnit* llvm::DwarfUnit::getCUNode ( ) const
inline

◆ getDIE()

DIE * DwarfUnit::getDIE ( const DINode D) const

◆ getDIELoc()

DIELoc* llvm::DwarfUnit::getDIELoc ( )
inline

◆ getDwarfVersion()

uint16_t llvm::DwarfUnit::getDwarfVersion ( ) const
inline

Definition at line 92 of file DwarfUnit.h.

References llvm::DwarfDebug::getDwarfVersion().

Referenced by llvm::DwarfCompileUnit::addAddrTableBase().

◆ getEndLabel()

MCSymbol* llvm::DwarfUnit::getEndLabel ( ) const
inline

Definition at line 88 of file DwarfUnit.h.

References EndLabel.

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

◆ getHeaderSize()

virtual unsigned llvm::DwarfUnit::getHeaderSize ( ) const
inlinevirtual

◆ getLanguage()

uint16_t llvm::DwarfUnit::getLanguage ( ) const
inline

◆ getMD5AsBytes()

MD5::MD5Result * DwarfUnit::getMD5AsBytes ( const DIFile File) const

◆ getOrCreateContextDIE()

DIE * DwarfUnit::getOrCreateContextDIE ( const DIScope Context)

◆ getOrCreateModule()

DIE * DwarfUnit::getOrCreateModule ( const DIModule M)

◆ getOrCreateNameSpace()

DIE * DwarfUnit::getOrCreateNameSpace ( const DINamespace NS)

◆ getOrCreateSourceID()

virtual unsigned llvm::DwarfUnit::getOrCreateSourceID ( const DIFile File)
protectedpure virtual

Look up the source ID for the given file.

If none currently exists, create a new ID and insert it in the line table.

Implemented in llvm::DwarfCompileUnit.

Referenced by getHeaderSize().

◆ getOrCreateStaticMemberDIE()

DIE * DwarfUnit::getOrCreateStaticMemberDIE ( const DIDerivedType DT)
protected

◆ getOrCreateSubprogramDIE()

DIE * DwarfUnit::getOrCreateSubprogramDIE ( const DISubprogram SP,
bool  Minimal = false 
)

◆ getOrCreateTypeDIE()

DIE * DwarfUnit::getOrCreateTypeDIE ( const MDNode TyNode)

◆ getParentContextString()

std::string DwarfUnit::getParentContextString ( const DIScope Context) const

◆ hasContent()

bool llvm::DwarfUnit::hasContent ( ) const
inline

Return true if this compile unit has something to write out.

Definition at line 95 of file DwarfUnit.h.

References addGlobalName(), addGlobalType(), Context, D, getDIE(), getParentContextString(), llvm::DIEUnit::getUnitDie(), llvm::DIE::hasChildren(), and Name.

◆ insertDIE()

void DwarfUnit::insertDIE ( const DINode Desc,
DIE D 
)

Insert DIE into the map.

We delegate the request to DwarfDebug when the MDNode can be part of the type system, since DIEs for the type system can be shared across CUs and the mappings are kept in DwarfDebug.

Definition at line 192 of file DwarfUnit.cpp.

References DU, llvm::DwarfFile::insertDIE(), isShareableAcrossCUs(), and MDNodeToDieMap.

Referenced by llvm::DwarfCompileUnit::constructImportedEntityDIE(), llvm::DwarfCompileUnit::constructLabelDIE(), createAndAddDIE(), and getDIELoc().

◆ isShareableAcrossCUs()

bool DwarfUnit::isShareableAcrossCUs ( const DINode D) const
protected

Check whether the DIE for this MDNode can be shared across CUs.

Definition at line 171 of file DwarfUnit.cpp.

References D, DD, llvm::DwarfDebug::generateTypeUnits(), and llvm::DwarfDebug::shareAcrossDWOCUs().

Referenced by getDIE(), and insertDIE().

◆ resolve()

template<typename T >
T* llvm::DwarfUnit::resolve ( TypedDINodeRef< T Ref) const
inlineprotected

◆ shareAcrossDWOCUs()

bool llvm::DwarfUnit::shareAcrossDWOCUs ( ) const
protected

◆ updateAcceleratorTables()

void DwarfUnit::updateAcceleratorTables ( const DIScope Context,
const DIType Ty,
const DIE TyDIE 
)
protected

◆ useSegmentedStringOffsetsTable()

bool llvm::DwarfUnit::useSegmentedStringOffsetsTable ( ) const
inline

Definition at line 256 of file DwarfUnit.h.

References llvm::DwarfDebug::useSegmentedStringOffsetsTable().

Referenced by addString().

Member Data Documentation

◆ Asm

AsmPrinter* llvm::DwarfUnit::Asm
protected

◆ ContainingTypeMap

DenseMap<DIE *, const DINode *> llvm::DwarfUnit::ContainingTypeMap
protected

This map is used to keep track of subprogram DIEs that need DW_AT_containing_type attribute.

This attribute points to a DIE that corresponds to the MDNode mapped with the subprogram DIE.

Definition at line 75 of file DwarfUnit.h.

Referenced by applySubprogramAttributes(), and constructContainingTypeDIEs().

◆ CUNode

const DICompileUnit* llvm::DwarfUnit::CUNode
protected

◆ DD

DwarfDebug* llvm::DwarfUnit::DD
protected

◆ DIEBlocks

std::vector<DIEBlock *> llvm::DwarfUnit::DIEBlocks
protected

A list of all the DIEBlocks in use.

Definition at line 67 of file DwarfUnit.h.

Referenced by addBlock(), and ~DwarfUnit().

◆ DIELocs

std::vector<DIELoc *> llvm::DwarfUnit::DIELocs
protected

A list of all the DIELocs in use.

Definition at line 70 of file DwarfUnit.h.

Referenced by addBlock(), and ~DwarfUnit().

◆ DIEValueAllocator

BumpPtrAllocator llvm::DwarfUnit::DIEValueAllocator
protected

◆ DU

DwarfFile* llvm::DwarfUnit::DU
protected

◆ EndLabel

MCSymbol* llvm::DwarfUnit::EndLabel = nullptr
protected

Emitted at the end of the CU and used to compute the CU Length field.

Definition at line 53 of file DwarfUnit.h.

Referenced by emitCommonHeader(), and getEndLabel().

◆ IndexTyDie

DIE* llvm::DwarfUnit::IndexTyDie
protected

An anonymous type for index type. Owned by DIEUnit.

Definition at line 60 of file DwarfUnit.h.

Referenced by applySubprogramAttributes().

◆ MDNodeToDieMap

DenseMap<const MDNode *, DIE *> llvm::DwarfUnit::MDNodeToDieMap
protected

Tracks the mapping of unit level debug information variables to debug information entries.

Definition at line 64 of file DwarfUnit.h.

Referenced by getDIE(), and insertDIE().


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