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

#include "CodeGen/AsmPrinter/DwarfUnit.h"

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

Public Member Functions

 DwarfTypeUnit (DwarfCompileUnit &CU, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU, unsigned UniqueID, MCDwarfDwoLineTable *SplitLineTable=nullptr)
 
void setTypeSignature (uint64_t Signature)
 
uint64_t getTypeSignature () const
 Returns Type Signature.
 
void setType (const DIE *Ty)
 
void emitHeader (bool UseOffsets) override
 Emit the header for this unit, not including the initial length field.
 
unsigned getHeaderSize () const override
 Compute the size of a header for this unit, not including the initial length field.
 
void addGlobalName (StringRef Name, const DIE &Die, const DIScope *Context) override
 Add a new global name to the compile unit.
 
void addGlobalType (const DIType *Ty, const DIE &Die, const DIScope *Context) override
 Add a new global type to the compile unit.
 
DwarfCompileUnitgetCU () override
 
- Public Member Functions inherited from llvm::DwarfUnit
unsigned getUniqueID () const
 Gets Unique ID for this unit.
 
AsmPrintergetAsmPrinter () const
 
MCSymbolgetLabelBegin () const
 Get the the symbol for start of the section for this unit.
 
MCSymbolgetEndLabel () const
 
uint16_t getLanguage () const
 
const DICompileUnitgetCUNode () const
 
DwarfDebuggetDwarfDebug () const
 
bool hasContent () const
 Return true if this compile unit has something to write out.
 
std::string getParentContextString (const DIScope *Context) const
 Get string containing language specific context for a global name.
 
virtual void addGlobalName (StringRef Name, const DIE &Die, const DIScope *Context)=0
 Add a new global name to the compile unit.
 
virtual void addGlobalType (const DIType *Ty, const DIE &Die, const DIScope *Context)=0
 Add a new global type to the compile unit.
 
DIEgetDIE (const DINode *D) const
 Returns the DIE map slot for the specified debug variable.
 
DIELocgetDIELoc ()
 Returns a fresh newly allocated DIELoc.
 
void insertDIE (const DINode *Desc, DIE *D)
 Insert DIE into the map.
 
void insertDIE (DIE *D)
 
void addFlag (DIE &Die, dwarf::Attribute Attribute)
 Add a flag that is true to the DIE.
 
void addUInt (DIEValueList &Die, dwarf::Attribute Attribute, std::optional< dwarf::Form > Form, uint64_t Integer)
 Add an unsigned integer attribute data and value.
 
void addUInt (DIEValueList &Block, dwarf::Form Form, uint64_t Integer)
 
void addSInt (DIEValueList &Die, dwarf::Attribute Attribute, std::optional< dwarf::Form > Form, int64_t Integer)
 Add an signed integer attribute data and value.
 
void addSInt (DIELoc &Die, std::optional< dwarf::Form > Form, int64_t Integer)
 
void addString (DIE &Die, dwarf::Attribute Attribute, StringRef Str)
 Add a string attribute data and value.
 
void addLabel (DIEValueList &Die, dwarf::Attribute Attribute, dwarf::Form Form, const MCSymbol *Label)
 Add a Dwarf label attribute data and value.
 
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.
 
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.
 
void addPoolOpAddress (DIEValueList &Die, const MCSymbol *Label)
 
void addLabelDelta (DIEValueList &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
 Add a label delta attribute data and value.
 
void addDIEEntry (DIE &Die, dwarf::Attribute Attribute, DIE &Entry)
 Add a DIE attribute data and value.
 
void addDIEEntry (DIE &Die, dwarf::Attribute Attribute, DIEEntry Entry)
 Add a DIE attribute data and value.
 
void addDIETypeSignature (DIE &Die, uint64_t Signature)
 Add a type's DW_AT_signature and set the declaration flag.
 
void addBlock (DIE &Die, dwarf::Attribute Attribute, DIELoc *Loc)
 Add block data.
 
void addBlock (DIE &Die, dwarf::Attribute Attribute, DIEBlock *Block)
 Add block data.
 
void addBlock (DIE &Die, dwarf::Attribute Attribute, dwarf::Form Form, DIEBlock *Block)
 
void addSourceLine (DIE &Die, unsigned Line, const DIFile *File)
 Add location information to specified debug information entry.
 
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 ConstantInt *CI, const DIType *Ty)
 Add constant value entry in variable DIE.
 
void addConstantValue (DIE &Die, const APInt &Val, const DIType *Ty)
 
void addConstantValue (DIE &Die, const APInt &Val, bool Unsigned)
 
void addConstantValue (DIE &Die, uint64_t Val, const DIType *Ty)
 
void addConstantValue (DIE &Die, bool Unsigned, uint64_t Val)
 
void addConstantFPValue (DIE &Die, const ConstantFP *CFP)
 Add constant value entry in variable DIE.
 
void addLinkageName (DIE &Die, StringRef LinkageName)
 Add a linkage name, if it isn't empty.
 
void addTemplateParams (DIE &Buffer, DINodeArray TParams)
 Add template parameters in buffer.
 
void addThrownTypes (DIE &Die, DINodeArray ThrownTypes)
 Add thrown types.
 
void addAccess (DIE &Die, DINode::DIFlags Flags)
 Add the accessibility attribute.
 
void addType (DIE &Entity, const DIType *Ty, dwarf::Attribute Attribute=dwarf::DW_AT_type)
 Add a new type attribute to the specified entity.
 
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)
 
DIEcreateTypeDIE (const DIScope *Context, DIE &ContextDIE, const DIType *Ty)
 Creates type DIE with specific context.
 
virtual DIEgetOrCreateTypeDIE (const MDNode *TyNode)
 Find existing DIE or create new DIE for the given type.
 
virtual DIEgetOrCreateContextDIE (const DIScope *Context)
 Get context owner's DIE.
 
void constructContainingTypeDIEs ()
 Construct DIEs for types that contain vtables.
 
void constructSubprogramArguments (DIE &Buffer, DITypeRefArray Args)
 Construct function argument DIEs.
 
DIEcreateAndAddDIE (dwarf::Tag 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.
 
bool useSegmentedStringOffsetsTable () const
 
virtual unsigned getHeaderSize () const
 Compute the size of a header for this unit, not including the initial length field.
 
virtual void emitHeader (bool UseOffsets)=0
 Emit the header for this unit, not including the initial length field.
 
void addStringOffsetsStart ()
 Add the DW_AT_str_offsets_base attribute to the unit DIE.
 
void addRnglistsBase ()
 Add the DW_AT_rnglists_base attribute to the unit DIE.
 
virtual DwarfCompileUnitgetCU ()=0
 
void constructTypeDIE (DIE &Buffer, const DICompositeType *CTy)
 
void addSectionDelta (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
 addSectionDelta - Add a label delta attribute data and value.
 
void addSectionLabel (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label, const MCSymbol *Sec)
 Add a Dwarf section label attribute data and value.
 
void addAnnotation (DIE &Buffer, DINodeArray Annotations)
 Add DW_TAG_LLVM_annotation.
 
DIEcreateTypeDIE (const DICompositeType *Ty)
 Get context owner's DIE.
 
- Public Member Functions inherited from llvm::DIEUnit
 DIEUnit (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.
 
virtual const MCSymbolgetCrossSectionRelativeBaseAddress () const
 
MCSectiongetSection () const
 Return the section that this DIEUnit will be emitted into.
 
void setDebugSectionOffset (uint64_t O)
 
uint64_t getDebugSectionOffset () 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, unsigned UniqueID=0)
 
bool applySubprogramDefinitionAttributes (const DISubprogram *SP, DIE &SPDie, bool Minimal)
 
bool isShareableAcrossCUs (const DINode *D) const
 Check whether the DIE for this MDNode can be shared across CUs.
 
template<typename T >
void addAttribute (DIEValueList &Die, dwarf::Attribute Attribute, dwarf::Form Form, T &&Value)
 
 ~DwarfUnit ()
 
DIEgetOrCreateStaticMemberDIE (const DIDerivedType *DT)
 Create new static data member DIE.
 
virtual unsigned getOrCreateSourceID (const DIFile *File)=0
 Look up the source ID for the given file.
 
void emitCommonHeader (bool UseOffsets, dwarf::UnitType UT)
 Emit the common part of the header for this unit.
 
- Protected Member Functions inherited from llvm::DIEUnit
virtual ~DIEUnit ()=default
 .debug_info or .debug_types absolute section offset.
 
- Protected Attributes inherited from llvm::DwarfUnit
unsigned UniqueID
 A numeric ID unique among all CUs in the module.
 
const DICompileUnitCUNode
 MDNode for the compile unit.
 
BumpPtrAllocator DIEValueAllocator
 
AsmPrinterAsm
 Target of Dwarf emission.
 
MCSymbolLabelBegin = nullptr
 The start of the unit within its section.
 
MCSymbolEndLabel = nullptr
 Emitted at the end of the CU and used to compute the CU Length field.
 
DwarfDebugDD
 
DwarfFileDU
 
DIEIndexTyDie = nullptr
 An anonymous type for index type. Owned by DIEUnit.
 
DenseMap< const MDNode *, DIE * > MDNodeToDieMap
 Tracks the mapping of unit level debug information variables to debug information entries.
 
std::vector< DIEBlock * > DIEBlocks
 A list of all the DIEBlocks in use.
 
std::vector< DIELoc * > DIELocs
 A list of all the DIELocs in use.
 
DenseMap< DIE *, const DINode * > ContainingTypeMap
 This map is used to keep track of subprogram DIEs that need DW_AT_containing_type attribute.
 

Detailed Description

Definition at line 371 of file DwarfUnit.h.

Constructor & Destructor Documentation

◆ DwarfTypeUnit()

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

Definition at line 88 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 1829 of file DwarfUnit.cpp.

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

◆ addGlobalType()

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

Add a new global type to the compile unit.

Implements llvm::DwarfUnit.

Definition at line 1834 of file DwarfUnit.cpp.

References llvm::DwarfCompileUnit::addGlobalTypeUnitType(), Context, and getCU().

◆ emitHeader()

void DwarfTypeUnit::emitHeader ( bool  UseOffsets)
overridevirtual

◆ getCU()

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

Implements llvm::DwarfUnit.

Definition at line 402 of file DwarfUnit.h.

Referenced by addGlobalName(), and addGlobalType().

◆ 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 394 of file DwarfUnit.h.

References llvm::DwarfUnit::Asm, llvm::AsmPrinter::getDwarfOffsetByteSize(), and llvm::DwarfUnit::getHeaderSize().

◆ getTypeSignature()

uint64_t llvm::DwarfTypeUnit::getTypeSignature ( ) const
inline

Returns Type Signature.

Definition at line 389 of file DwarfUnit.h.

◆ setType()

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

Definition at line 390 of file DwarfUnit.h.

Referenced by llvm::DwarfDebug::addDwarfTypeUnitType().

◆ setTypeSignature()

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

Definition at line 387 of file DwarfUnit.h.

Referenced by llvm::DwarfDebug::addDwarfTypeUnitType().


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