LLVM  8.0.1
Public Member Functions | List of all members
llvm::DwarfTypeUnit Class Referencefinal

#include "CodeGen/AsmPrinter/DwarfUnit.h"

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

Public Member Functions

 DwarfTypeUnit (DwarfCompileUnit &CU, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU, MCDwarfDwoLineTable *SplitLineTable=nullptr)
 
void setTypeSignature (uint64_t Signature)
 
void setType (const DIE *Ty)
 
DIEcreateTypeDIE (const DICompositeType *Ty)
 Get context owner's DIE. More...
 
void emitHeader (bool UseOffsets) override
 Emit the header for this unit, not including the initial length field. More...
 
unsigned getHeaderSize () const override
 Compute the size of a header for this unit, not including the initial length field. More...
 
void addGlobalName (StringRef Name, const DIE &Die, const DIScope *Context) override
 Add a new global name to the compile unit. More...
 
void addGlobalType (const DIType *Ty, const DIE &Die, const DIScope *Context) override
 Add a new global type to the compile unit. More...
 
DwarfCompileUnitgetCU () override
 
- Public Member Functions inherited from llvm::DwarfUnit
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...
 
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
 
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...
 
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
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::DwarfUnit
 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...
 
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 inherited from llvm::DwarfUnit
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

Definition at line 351 of file DwarfUnit.h.

Constructor & Destructor Documentation

◆ DwarfTypeUnit()

DwarfTypeUnit::DwarfTypeUnit ( DwarfCompileUnit CU,
AsmPrinter A,
DwarfDebug DW,
DwarfFile DWU,
MCDwarfDwoLineTable SplitLineTable = nullptr 
)

Definition at line 78 of file DwarfUnit.cpp.

Member Function Documentation

◆ addGlobalName()

void DwarfTypeUnit::addGlobalName ( StringRef  Name,
const DIE Die,
const DIScope Context 
)
overridevirtual

Add a new global name to the compile unit.

Implements llvm::DwarfUnit.

Definition at line 1632 of file DwarfUnit.cpp.

References llvm::DwarfCompileUnit::addGlobalNameForTypeUnit(), and getCU().

Referenced by llvm::DwarfUnit::getOrCreateModule(), and llvm::DwarfUnit::getOrCreateNameSpace().

◆ addGlobalType()

void DwarfTypeUnit::addGlobalType ( const DIType Ty,
const DIE Die,
const DIScope Context 
)
overridevirtual

◆ createTypeDIE()

DIE * DwarfTypeUnit::createTypeDIE ( const DICompositeType Ty)

◆ emitHeader()

void DwarfTypeUnit::emitHeader ( bool  UseOffsets)
overridevirtual

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

Implements llvm::DwarfUnit.

Definition at line 1594 of file DwarfUnit.cpp.

References llvm::DwarfUnit::Asm, llvm::DwarfUnit::DD, llvm::DwarfUnit::emitCommonHeader(), llvm::DIE::getOffset(), llvm::AsmPrinter::OutStreamer, and llvm::DwarfDebug::useSplitDwarf().

◆ getCU()

DwarfCompileUnit& llvm::DwarfTypeUnit::getCU ( )
inlineoverridevirtual

◆ getHeaderSize()

unsigned llvm::DwarfTypeUnit::getHeaderSize ( ) const
inlineoverridevirtual

Compute the size of a header for this unit, not including the initial length field.

Reimplemented from llvm::DwarfUnit.

Definition at line 373 of file DwarfUnit.h.

References llvm::DwarfUnit::addGlobalName(), llvm::DwarfUnit::addGlobalType(), Context, llvm::DwarfUnit::getHeaderSize(), and Name.

Referenced by llvm::DwarfUnit::emitCommonHeader().

◆ setType()

void llvm::DwarfTypeUnit::setType ( const DIE Ty)
inline

Definition at line 366 of file DwarfUnit.h.

References llvm::DwarfUnit::emitHeader().

◆ setTypeSignature()

void llvm::DwarfTypeUnit::setTypeSignature ( uint64_t  Signature)
inline

Definition at line 365 of file DwarfUnit.h.


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