LLVM 22.0.0git
llvm::DwarfCompileUnit Class Referencefinal

#include "CodeGen/AsmPrinter/DwarfCompileUnit.h"

Inheritance diagram for llvm::DwarfCompileUnit:
[legend]

Classes

struct  BaseTypeRef
struct  GlobalExpr
 A pair of GlobalVariable and DIExpression. More...

Public Types

using InlinedEntity = DbgValueHistoryMap::InlinedEntity
 Find abstract variable associated with Var.

Public Member Functions

 DwarfCompileUnit (unsigned UID, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU, UnitKind Kind=UnitKind::Full)
bool hasRangeLists () const
DwarfCompileUnitgetSkeleton () const
bool includeMinimalInlineScopes () const
bool emitFuncLineTableOffsets () const
void initStmtList ()
void applyStmtList (DIE &D)
 Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
MCSymbolgetLineTableStartSym () const
 Get line table start symbol for this unit.
DIEgetOrCreateGlobalVariableDIE (const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
 Get or create global variable DIE.
DIEgetOrCreateCommonBlock (const DICommonBlock *CB, ArrayRef< GlobalExpr > GlobalExprs)
void addLocationAttribute (DIE *ToDIE, const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
void addLabelAddress (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
 addLabelAddress - Add a dwarf label attribute data and value using either DW_FORM_addr or DW_FORM_GNU_addr_index.
void addLocalLabelAddress (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
 addLocalLabelAddress - Add a dwarf label attribute data and value using DW_FORM_addr only.
DwarfCompileUnitgetCU () override
unsigned getOrCreateSourceID (const DIFile *File) override
 Look up the source ID for the given file.
void addRange (RangeSpan Range)
 addRange - Add an address range to the list of ranges for this unit.
void attachLowHighPC (DIE &D, const MCSymbol *Begin, const MCSymbol *End)
DIEupdateSubprogramScopeDIE (const DISubprogram *SP, const Function &F, MCSymbol *LineTableSym)
 Find DIE for the given subprogram and attach appropriate DW_AT_low_pc, DW_AT_high_pc and DW_AT_LLVM_stmt_sequence attributes.
void constructScopeDIE (LexicalScope *Scope, DIE &ParentScopeDIE)
void addScopeRangeList (DIE &ScopeDIE, SmallVector< RangeSpan, 2 > Range)
 A helper function to construct a RangeSpanList for a given lexical scope.
void attachRangesOrLowHighPC (DIE &D, SmallVector< RangeSpan, 2 > Ranges)
void attachRangesOrLowHighPC (DIE &D, const SmallVectorImpl< InsnRange > &Ranges)
DIEconstructInlinedScopeDIE (LexicalScope *Scope, DIE &ParentScopeDIE)
 This scope represents an inlined body of a function.
DIEconstructLexicalScopeDIE (LexicalScope *Scope)
 Construct new DW_TAG_lexical_block for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels.
DIEgetLexicalBlockDIE (const DILexicalBlock *LB)
 Get a DIE for the given DILexicalBlock.
DIEconstructVariableDIE (DbgVariable &DV, bool Abstract=false)
 Construct a DIE for the given DbgVariable.
DIEconstructVariableDIE (DbgVariable &DV, const LexicalScope &Scope, DIE *&ObjectPointer)
 Convenience overload which writes the DIE pointer into an out variable ObjectPointer in addition to returning it.
DIEconstructLabelDIE (DbgLabel &DL, const LexicalScope &Scope)
 Construct a DIE for the given DbgLabel.
void createBaseTypeDIEs ()
DIEgetOrCreateContextDIE (const DIScope *Ty) override
 Construct a DIE for a given scope.
DIEgetOrCreateSubprogramDIE (const DISubprogram *SP, const Function *F, bool Minimal=false) override
DIEconstructSubprogramScopeDIE (const DISubprogram *Sub, const Function &F, LexicalScope *Scope, MCSymbol *LineTableSym)
 Construct a DIE for this subprogram scope.
DIEcreateAndAddScopeChildren (LexicalScope *Scope, DIE &ScopeDIE)
DIEgetOrCreateAbstractSubprogramDIE (const DISubprogram *SP)
 Create an abstract subprogram DIE, that should later be populated by constructAbstractSubprogramScopeDIE.
void constructAbstractSubprogramScopeDIE (LexicalScope *Scope)
bool useGNUAnalogForDwarf5Feature () const
 Whether to use the GNU analog for a DWARF5 tag, attribute, or location atom.
dwarf::Tag getDwarf5OrGNUTag (dwarf::Tag Tag) const
 This takes a DWARF 5 tag and returns it or a GNU analog.
dwarf::Attribute getDwarf5OrGNUAttr (dwarf::Attribute Attr) const
 This takes a DWARF 5 attribute and returns it or a GNU analog.
dwarf::LocationAtom getDwarf5OrGNULocationAtom (dwarf::LocationAtom Loc) const
 This takes a DWARF 5 location atom and either returns it or a GNU analog.
DIEconstructCallSiteEntryDIE (DIE &ScopeDIE, const DISubprogram *CalleeSP, const Function *CalleeF, bool IsTail, const MCSymbol *PCAddr, const MCSymbol *CallAddr, unsigned CallReg, DIType *AllocSiteTy)
 Construct a call site entry DIE describing a call within Scope to a callee described by CalleeSP and CalleeF.
void constructCallSiteParmEntryDIEs (DIE &CallSiteDIE, SmallVector< DbgCallSiteParam, 4 > &Params)
 Construct call site parameter DIEs for the CallSiteDIE.
DIEgetOrCreateImportedEntityDIE (const DIImportedEntity *IE)
 Get or create a DIE for an imported entity.
DIEconstructImportedEntityDIE (const DIImportedEntity *IE)
void finishSubprogramDefinition (const DISubprogram *SP)
void finishEntityDefinition (const DbgEntity *Entity)
void attachLexicalScopesAbstractOrigins ()
DbgEntitygetExistingAbstractEntity (const DINode *Node)
void createAbstractEntity (const DINode *Node, LexicalScope *Scope)
void setSkeleton (DwarfCompileUnit &Skel)
 Set the skeleton unit associated with this unit.
unsigned getHeaderSize () const override
 Compute the size of a header for this unit, not including the initial length field.
unsigned getLength ()
void emitHeader (bool UseOffsets) override
 Emit the header for this unit, not including the initial length field.
void addAddrTableBase ()
 Add the DW_AT_addr_base attribute to the unit DIE.
MCSymbolgetMacroLabelBegin () const
void addGlobalName (StringRef Name, const DIE &Die, const DIScope *Context) override
 Add a new global name to the compile unit.
void addGlobalNameForTypeUnit (StringRef Name, const DIScope *Context)
 Add a new global name present in a type unit to this compile unit.
void addGlobalTypeImpl (const DIType *Ty, const DIE &Die, const DIScope *Context) override
 Add a new global type to the compile unit.
void addGlobalTypeUnitType (const DIType *Ty, const DIScope *Context)
 Add a new global type present in a type unit to this compile unit.
const StringMap< const DIE * > & getGlobalNames () const
const StringMap< const DIE * > & getGlobalTypes () const
void addVariableAddress (const DbgVariable &DV, DIE &Die, MachineLocation Location)
 Add DW_AT_location attribute for a DbgVariable based on provided MachineLocation.
void addAddress (DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
 Add an address attribute to a die based on the location provided.
void addComplexAddress (const DIExpression *DIExpr, 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 variable (navigating the extra location information encoded in the type) based on the starting location.
void addLocationList (DIE &Die, dwarf::Attribute Attribute, unsigned Index)
 Add a Dwarf loclistptr attribute data and value.
void applyCommonDbgVariableAttributes (const DbgVariable &Var, DIE &VariableDie)
 Add attributes to Var which reflect the common attributes of VariableDie, namely those which are not dependant on the active variant.
void addExpr (DIELoc &Die, dwarf::Form Form, const MCExpr *Expr)
 Add a Dwarf expression attribute data and value.
void applySubprogramAttributesToDefinition (const DISubprogram *SP, DIE &SPDie)
void applyLabelAttributes (const DbgLabel &Label, DIE &LabelDie)
const SmallVectorImpl< RangeSpan > & getRanges () const
 getRanges - Get the list of ranges for this unit.
SmallVector< RangeSpan, 2 > takeRanges ()
void setBaseAddress (const MCSymbol *Base)
const MCSymbolgetBaseAddress () const
uint64_t getDWOId () const
void setDWOId (uint64_t DwoId)
bool hasDwarfPubSections () const
void addBaseTypeRef (DIEValueList &Die, int64_t Idx)
MDNodeSetVectorgetDeferredLocalDecls ()
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.
void addGlobalType (const DIType *Ty, const DIE &Die, const DIScope *Context)
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 (DIEValueList &Die, std::optional< dwarf::Form > Form, int64_t Integer)
void addInt (DIE &Die, dwarf::Attribute Attribute, const APInt &Integer, bool Unsigned)
 Add an integer attribute data and value; value may be any width.
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, unsigned Column, 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)
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.
void constructContainingTypeDIEs ()
 Construct DIEs for types that contain vtables.
std::optional< unsignedconstructSubprogramArguments (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
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.
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.
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.
Public Member Functions inherited from llvm::DIEUnit
LLVM_ABI 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.
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

Public Attributes

std::vector< BaseTypeRefExprRefedBaseTypes

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.
void emitCommonHeader (bool UseOffsets, dwarf::UnitType UT)
 Emit the common part of the header for this unit.
bool shouldPlaceInUnitDIE (const DISubprogram *SP, bool Minimal)
DIEgetOrCreateSubprogramContextDIE (const DISubprogram *SP, bool IgnoreScope)
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 45 of file DwarfCompileUnit.h.

Member Typedef Documentation

◆ InlinedEntity

Find abstract variable associated with Var.

Definition at line 335 of file DwarfCompileUnit.h.

Constructor & Destructor Documentation

◆ DwarfCompileUnit()

Member Function Documentation

◆ addAddress()

◆ addAddrTableBase()

void DwarfCompileUnit::addAddrTableBase ( )

◆ addBaseTypeRef()

void DwarfCompileUnit::addBaseTypeRef ( DIEValueList & Die,
int64_t Idx )

◆ addComplexAddress()

void DwarfCompileUnit::addComplexAddress ( const DIExpression * DIExpr,
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 variable (navigating the extra location information encoded in the type) based on the starting location.

Start with the address based on the location provided, and generate the DWARF information necessary to find the actual variable given the extra address information encoded in the DbgVariable, starting from the starting location.

Add the DWARF information to the die.

Definition at line 1669 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::addBlock(), llvm::DwarfExpression::addExpression(), llvm::DwarfExpression::addFragmentOffset(), llvm::DwarfExpression::addMachineRegExpression(), llvm::DwarfUnit::addUInt(), llvm::DwarfUnit::Asm, llvm::DwarfExpression::beginEntryValueExpression(), llvm::DwarfUnit::DIEValueAllocator, llvm::DIEDwarfExpression::finalize(), llvm::DIExpression::isEntryValue(), llvm::DwarfExpression::setLocation(), llvm::DwarfExpression::TagOffset, and TRI.

Referenced by addVariableAddress().

◆ addExpr()

void DwarfCompileUnit::addExpr ( DIELoc & Die,
dwarf::Form Form,
const MCExpr * Expr )

Add a Dwarf expression attribute data and value.

Definition at line 1738 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::addAttribute().

Referenced by addLocationAttribute().

◆ addGlobalName()

void DwarfCompileUnit::addGlobalName ( StringRef Name,
const DIE & Die,
const DIScope * Context )
overridevirtual

Add a new global name to the compile unit.

addGlobalName - Add a new global name to the compile unit.

Implements llvm::DwarfUnit.

Definition at line 1593 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::getParentContextString(), and hasDwarfPubSections().

Referenced by applySubprogramAttributesToDefinition(), getOrCreateCommonBlock(), and getOrCreateGlobalVariableDIE().

◆ addGlobalNameForTypeUnit()

void DwarfCompileUnit::addGlobalNameForTypeUnit ( StringRef Name,
const DIScope * Context )

Add a new global name present in a type unit to this compile unit.

Definition at line 1601 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::getParentContextString(), llvm::DIEUnit::getUnitDie(), and hasDwarfPubSections().

Referenced by llvm::DwarfTypeUnit::addGlobalName().

◆ addGlobalTypeImpl()

void DwarfCompileUnit::addGlobalTypeImpl ( const DIType * Ty,
const DIE & Die,
const DIScope * Context )
overridevirtual

Add a new global type to the compile unit.

Add a new global type to the unit.

Implements llvm::DwarfUnit.

Definition at line 1614 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::getParentContextString(), and hasDwarfPubSections().

◆ addGlobalTypeUnitType()

void DwarfCompileUnit::addGlobalTypeUnitType ( const DIType * Ty,
const DIScope * Context )

Add a new global type present in a type unit to this compile unit.

Definition at line 1622 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::getParentContextString(), llvm::DIEUnit::getUnitDie(), and hasDwarfPubSections().

Referenced by llvm::DwarfTypeUnit::addGlobalTypeImpl().

◆ addLabelAddress()

void DwarfCompileUnit::addLabelAddress ( DIE & Die,
dwarf::Attribute Attribute,
const MCSymbol * Label )

addLabelAddress - Add a dwarf label attribute data and value using either DW_FORM_addr or DW_FORM_GNU_addr_index.

addLabelAddress - Add a dwarf label attribute data and value using DW_FORM_addr or DW_FORM_GNU_addr_index.

Definition at line 109 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::addAttribute(), llvm::DwarfUnit::addBlock(), addLocalLabelAddress(), llvm::DwarfUnit::addPoolOpAddress(), assert(), llvm::sampleprof::Base, llvm::DwarfUnit::DD, and llvm::DwarfUnit::DIEValueAllocator.

Referenced by attachLowHighPC(), constructCallSiteEntryDIE(), and finishEntityDefinition().

◆ addLocalLabelAddress()

void DwarfCompileUnit::addLocalLabelAddress ( DIE & Die,
dwarf::Attribute Attribute,
const MCSymbol * Label )

addLocalLabelAddress - Add a dwarf label attribute data and value using DW_FORM_addr only.

Definition at line 149 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::addAttribute().

Referenced by addLabelAddress().

◆ addLocationAttribute()

◆ addLocationList()

void DwarfCompileUnit::addLocationList ( DIE & Die,
dwarf::Attribute Attribute,
unsigned Index )

Add a Dwarf loclistptr attribute data and value.

Definition at line 1696 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::addAttribute(), and llvm::DwarfUnit::DD.

◆ addRange()

void DwarfCompileUnit::addRange ( RangeSpan Range)

addRange - Add an address range to the list of ranges for this unit.

Definition at line 438 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::DD, and Range.

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

◆ addScopeRangeList()

◆ addVariableAddress()

void DwarfCompileUnit::addVariableAddress ( const DbgVariable & DV,
DIE & Die,
MachineLocation Location )

Add DW_AT_location attribute for a DbgVariable based on provided MachineLocation.

Definition at line 1634 of file DwarfCompileUnit.cpp.

References addAddress(), and addComplexAddress().

◆ applyCommonDbgVariableAttributes()

void DwarfCompileUnit::applyCommonDbgVariableAttributes ( const DbgVariable & Var,
DIE & VariableDie )

◆ applyLabelAttributes()

◆ applyStmtList()

void DwarfCompileUnit::applyStmtList ( DIE & D)

Apply the DW_AT_stmt_list from this compile unit to the specified DIE.

Definition at line 482 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::addSectionLabel(), llvm::DwarfUnit::Asm, D(), llvm::MCSection::getBeginSymbol(), and llvm::MCObjectFileInfo::getDwarfLineSection().

◆ applySubprogramAttributesToDefinition()

void DwarfCompileUnit::applySubprogramAttributesToDefinition ( const DISubprogram * SP,
DIE & SPDie )

◆ attachLexicalScopesAbstractOrigins()

void DwarfCompileUnit::attachLexicalScopesAbstractOrigins ( )

Definition at line 1522 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::addDIEEntry(), and lookup().

◆ attachLowHighPC()

void DwarfCompileUnit::attachLowHighPC ( DIE & D,
const MCSymbol * Begin,
const MCSymbol * End )

◆ attachRangesOrLowHighPC() [1/2]

void DwarfCompileUnit::attachRangesOrLowHighPC ( DIE & D,
const SmallVectorImpl< InsnRange > & Ranges )

◆ attachRangesOrLowHighPC() [2/2]

◆ constructAbstractSubprogramScopeDIE()

void DwarfCompileUnit::constructAbstractSubprogramScopeDIE ( LexicalScope * Scope)

◆ constructCallSiteEntryDIE()

DIE & DwarfCompileUnit::constructCallSiteEntryDIE ( DIE & ScopeDIE,
const DISubprogram * CalleeSP,
const Function * CalleeF,
bool IsTail,
const MCSymbol * PCAddr,
const MCSymbol * CallAddr,
unsigned CallReg,
DIType * AllocSiteTy )

Construct a call site entry DIE describing a call within Scope to a callee described by CalleeSP and CalleeF.

IsTail specifies whether the call is a tail call. PCAddr points to the PC value after the call instruction. CallAddr points to the PC value at the call instruction (or is null). CallReg is a register location for an indirect call. For direct calls the CallReg is set to 0.

Definition at line 1319 of file DwarfCompileUnit.cpp.

References addAddress(), llvm::DwarfUnit::addDIEEntry(), llvm::DwarfUnit::addFlag(), addLabelAddress(), llvm::DwarfUnit::addLinkageName(), AddLinkageNamesToDeclCallOriginsForTuning(), llvm::DwarfUnit::addType(), assert(), llvm::DwarfUnit::createAndAddDIE(), llvm::DwarfUnit::DD, llvm::DIE::findAttribute(), getDwarf5OrGNUAttr(), getDwarf5OrGNUTag(), getOrCreateSubprogramDIE(), and useGNUAnalogForDwarf5Feature().

◆ constructCallSiteParmEntryDIEs()

void DwarfCompileUnit::constructCallSiteParmEntryDIEs ( DIE & CallSiteDIE,
SmallVector< DbgCallSiteParam, 4 > & Params )

Construct call site parameter DIEs for the CallSiteDIE.

The Params were collected by the collectCallSiteParameters. Note: The order of parameters does not matter, since debuggers recognize call site parameters by the DW_AT_location attribute.

Definition at line 1382 of file DwarfCompileUnit.cpp.

References addAddress(), llvm::DwarfUnit::addBlock(), llvm::DIE::addChild(), llvm::DwarfUnit::Asm, llvm::DwarfUnit::DIEValueAllocator, llvm::DwarfDebug::emitDebugLocValue(), llvm::DIEDwarfExpression::finalize(), llvm::DIE::get(), getDwarf5OrGNUAttr(), getDwarf5OrGNUTag(), llvm::DwarfUnit::insertDIE(), and llvm::DwarfExpression::setCallSiteParamValueFlag().

◆ constructImportedEntityDIE()

◆ constructInlinedScopeDIE()

DIE * DwarfCompileUnit::constructInlinedScopeDIE ( LexicalScope * Scope,
DIE & ParentScopeDIE )

This scope represents an inlined body of a function.

Construct a DIE to represent this concrete inlined copy of the function.

Definition at line 734 of file DwarfCompileUnit.cpp.

References llvm::DIE::addChild(), llvm::DwarfUnit::addDIEEntry(), llvm::DwarfUnit::addUInt(), assert(), attachRangesOrLowHighPC(), llvm::DwarfUnit::CUNode, llvm::DwarfUnit::DD, llvm::DwarfUnit::DIEValueAllocator, llvm::DIE::get(), llvm::getDISubprogram(), and getOrCreateSourceID().

Referenced by constructScopeDIE().

◆ constructLabelDIE()

DIE * DwarfCompileUnit::constructLabelDIE ( DbgLabel & DL,
const LexicalScope & Scope )

◆ constructLexicalScopeDIE()

DIE * DwarfCompileUnit::constructLexicalScopeDIE ( LexicalScope * Scope)

Construct new DW_TAG_lexical_block for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels.

Definition at line 771 of file DwarfCompileUnit.cpp.

References assert(), attachRangesOrLowHighPC(), llvm::count(), llvm::DwarfUnit::DD, llvm::DwarfUnit::DIEValueAllocator, and llvm::DIE::get().

Referenced by constructScopeDIE().

◆ constructScopeDIE()

void DwarfCompileUnit::constructScopeDIE ( LexicalScope * Scope,
DIE & ParentScopeDIE )

◆ constructSubprogramScopeDIE()

◆ constructVariableDIE() [1/2]

◆ constructVariableDIE() [2/2]

DIE * DwarfCompileUnit::constructVariableDIE ( DbgVariable & DV,
const LexicalScope & Scope,
DIE *& ObjectPointer )

Convenience overload which writes the DIE pointer into an out variable ObjectPointer in addition to returning it.

Definition at line 1001 of file DwarfCompileUnit.cpp.

References constructVariableDIE(), and llvm::DbgVariable::isObjectPointer().

◆ createAbstractEntity()

void DwarfCompileUnit::createAbstractEntity ( const DINode * Node,
LexicalScope * Scope )

◆ createAndAddScopeChildren()

◆ createBaseTypeDIEs()

◆ emitFuncLineTableOffsets()

bool DwarfCompileUnit::emitFuncLineTableOffsets ( ) const

Definition at line 1764 of file DwarfCompileUnit.cpp.

References EmitFuncLineTableOffsetsOption.

Referenced by updateSubprogramScopeDIE().

◆ emitHeader()

void DwarfCompileUnit::emitHeader ( bool UseOffsets)
overridevirtual

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

Implements llvm::DwarfUnit.

Definition at line 1558 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::Asm, llvm::DwarfUnit::DD, llvm::DwarfUnit::emitCommonHeader(), getDWOId(), and llvm::DwarfUnit::LabelBegin.

◆ finishEntityDefinition()

◆ finishSubprogramDefinition()

◆ getBaseAddress()

const MCSymbol * llvm::DwarfCompileUnit::getBaseAddress ( ) const
inline

Definition at line 417 of file DwarfCompileUnit.h.

◆ getCU()

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

Implements llvm::DwarfUnit.

Definition at line 223 of file DwarfCompileUnit.h.

References DwarfCompileUnit().

Referenced by getOrCreateCommonBlock(), and getOrCreateSubprogramDIE().

◆ getDeferredLocalDecls()

MDNodeSetVector & llvm::DwarfCompileUnit::getDeferredLocalDecls ( )
inline

Definition at line 426 of file DwarfCompileUnit.h.

◆ getDwarf5OrGNUAttr()

dwarf::Attribute DwarfCompileUnit::getDwarf5OrGNUAttr ( dwarf::Attribute Attr) const

This takes a DWARF 5 attribute and returns it or a GNU analog.

Definition at line 1286 of file DwarfCompileUnit.cpp.

References llvm_unreachable, and useGNUAnalogForDwarf5Feature().

Referenced by constructCallSiteEntryDIE(), and constructCallSiteParmEntryDIEs().

◆ getDwarf5OrGNULocationAtom()

dwarf::LocationAtom DwarfCompileUnit::getDwarf5OrGNULocationAtom ( dwarf::LocationAtom Loc) const

This takes a DWARF 5 location atom and either returns it or a GNU analog.

Definition at line 1308 of file DwarfCompileUnit.cpp.

References llvm_unreachable, and useGNUAnalogForDwarf5Feature().

◆ getDwarf5OrGNUTag()

dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUTag ( dwarf::Tag Tag) const

This takes a DWARF 5 tag and returns it or a GNU analog.

Definition at line 1272 of file DwarfCompileUnit.cpp.

References llvm_unreachable, llvm::Tag, and useGNUAnalogForDwarf5Feature().

Referenced by constructCallSiteEntryDIE(), and constructCallSiteParmEntryDIEs().

◆ getDWOId()

uint64_t llvm::DwarfCompileUnit::getDWOId ( ) const
inline

Definition at line 419 of file DwarfCompileUnit.h.

Referenced by emitHeader().

◆ getExistingAbstractEntity()

DbgEntity * DwarfCompileUnit::getExistingAbstractEntity ( const DINode * Node)

Definition at line 1535 of file DwarfCompileUnit.cpp.

References I.

Referenced by llvm::DwarfDebug::endFunctionImpl(), and finishEntityDefinition().

◆ getGlobalNames()

const StringMap< const DIE * > & llvm::DwarfCompileUnit::getGlobalNames ( ) const
inline

Definition at line 377 of file DwarfCompileUnit.h.

◆ getGlobalTypes()

const StringMap< const DIE * > & llvm::DwarfCompileUnit::getGlobalTypes ( ) const
inline

Definition at line 378 of file DwarfCompileUnit.h.

◆ getHeaderSize()

unsigned llvm::DwarfCompileUnit::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 342 of file DwarfCompileUnit.h.

References llvm::DwarfUnit::DD, and llvm::DwarfUnit::getHeaderSize().

Referenced by getLength().

◆ getLength()

unsigned llvm::DwarfCompileUnit::getLength ( )
inline

◆ getLexicalBlockDIE()

DIE * DwarfCompileUnit::getLexicalBlockDIE ( const DILexicalBlock * LB)

Get a DIE for the given DILexicalBlock.

Note that this function assumes that the DIE has been already created and it's an error, if it hasn't.

Definition at line 1803 of file DwarfCompileUnit.cpp.

References assert(), and llvm::DILocalScope::getSubprogram().

Referenced by getOrCreateContextDIE().

◆ getLineTableStartSym()

MCSymbol * llvm::DwarfCompileUnit::getLineTableStartSym ( ) const
inline

Get line table start symbol for this unit.

Definition at line 184 of file DwarfCompileUnit.h.

◆ getMacroLabelBegin()

MCSymbol * llvm::DwarfCompileUnit::getMacroLabelBegin ( ) const
inline

Definition at line 359 of file DwarfCompileUnit.h.

◆ getOrCreateAbstractSubprogramDIE()

DIE & DwarfCompileUnit::getOrCreateAbstractSubprogramDIE ( const DISubprogram * SP)

Create an abstract subprogram DIE, that should later be populated by constructAbstractSubprogramScopeDIE.

Definition at line 1203 of file DwarfCompileUnit.cpp.

References lookup().

Referenced by getOrCreateSubprogramDIE().

◆ getOrCreateCommonBlock()

◆ getOrCreateContextDIE()

DIE * DwarfCompileUnit::getOrCreateContextDIE ( const DIScope * Ty)
overridevirtual

◆ getOrCreateGlobalVariableDIE()

◆ getOrCreateImportedEntityDIE()

DIE * DwarfCompileUnit::getOrCreateImportedEntityDIE ( const DIImportedEntity * IE)

Get or create a DIE for an imported entity.

Definition at line 1460 of file DwarfCompileUnit.cpp.

References llvm::DIE::addChild(), assert(), constructImportedEntityDIE(), llvm::DwarfUnit::getDIE(), and getOrCreateContextDIE().

Referenced by constructImportedEntityDIE().

◆ getOrCreateSourceID()

unsigned DwarfCompileUnit::getOrCreateSourceID ( const DIFile * File)
overridevirtual

Look up the source ID for the given file.

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

Implements llvm::DwarfUnit.

Definition at line 158 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::Asm, llvm::DwarfUnit::DD, and llvm::DwarfUnit::getUniqueID().

Referenced by constructInlinedScopeDIE().

◆ getOrCreateSubprogramDIE()

DIE * DwarfCompileUnit::getOrCreateSubprogramDIE ( const DISubprogram * SP,
const Function * F,
bool Minimal = false )
overridevirtual

◆ getRanges()

const SmallVectorImpl< RangeSpan > & llvm::DwarfCompileUnit::getRanges ( ) const
inline

getRanges - Get the list of ranges for this unit.

Definition at line 413 of file DwarfCompileUnit.h.

◆ getSkeleton()

DwarfCompileUnit * llvm::DwarfCompileUnit::getSkeleton ( ) const
inline

Definition at line 170 of file DwarfCompileUnit.h.

References DwarfCompileUnit().

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

◆ hasDwarfPubSections()

◆ hasRangeLists()

bool llvm::DwarfCompileUnit::hasRangeLists ( ) const
inline

Definition at line 168 of file DwarfCompileUnit.h.

◆ includeMinimalInlineScopes()

◆ initStmtList()

◆ setBaseAddress()

void llvm::DwarfCompileUnit::setBaseAddress ( const MCSymbol * Base)
inline

Definition at line 416 of file DwarfCompileUnit.h.

References llvm::sampleprof::Base.

◆ setDWOId()

void llvm::DwarfCompileUnit::setDWOId ( uint64_t DwoId)
inline

Definition at line 420 of file DwarfCompileUnit.h.

◆ setSkeleton()

void llvm::DwarfCompileUnit::setSkeleton ( DwarfCompileUnit & Skel)
inline

Set the skeleton unit associated with this unit.

Definition at line 340 of file DwarfCompileUnit.h.

References DwarfCompileUnit().

◆ takeRanges()

SmallVector< RangeSpan, 2 > llvm::DwarfCompileUnit::takeRanges ( )
inline

Definition at line 414 of file DwarfCompileUnit.h.

◆ updateSubprogramScopeDIE()

DIE & DwarfCompileUnit::updateSubprogramScopeDIE ( const DISubprogram * SP,
const Function & F,
MCSymbol * LineTableSym )

◆ useGNUAnalogForDwarf5Feature()

bool DwarfCompileUnit::useGNUAnalogForDwarf5Feature ( ) const

Whether to use the GNU analog for a DWARF5 tag, attribute, or location atom.

Only applicable when emitting otherwise DWARF4-compliant debug info.

Definition at line 1268 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::DD.

Referenced by constructCallSiteEntryDIE(), getDwarf5OrGNUAttr(), getDwarf5OrGNULocationAtom(), and getDwarf5OrGNUTag().

Member Data Documentation

◆ ExprRefedBaseTypes

std::vector<BaseTypeRef> llvm::DwarfCompileUnit::ExprRefedBaseTypes

Definition at line 200 of file DwarfCompileUnit.h.

Referenced by createBaseTypeDIEs().


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