LLVM  14.0.0git
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
llvm::DwarfCompileUnit Class Referencefinal

#include "CodeGen/AsmPrinter/DwarfCompileUnit.h"

Inheritance diagram for llvm::DwarfCompileUnit:
Inheritance graph
[legend]
Collaboration diagram for llvm::DwarfCompileUnit:
Collaboration graph
[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. More...
 

Public Member Functions

 DwarfCompileUnit (unsigned UID, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU, UnitKind Kind=UnitKind::Full)
 
bool hasRangeLists () const
 
unsigned getUniqueID () const
 
DwarfCompileUnitgetSkeleton () const
 
bool includeMinimalInlineScopes () const
 
void initStmtList ()
 
void applyStmtList (DIE &D)
 Apply the DW_AT_stmt_list from this compile unit to the specified DIE. More...
 
MCSymbolgetLineTableStartSym () const
 Get line table start symbol for this unit. More...
 
DIEgetOrCreateGlobalVariableDIE (const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
 Get or create global variable DIE. More...
 
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. More...
 
void addLocalLabelAddress (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
 addLocalLabelAddress - Add a dwarf label attribute data and value using DW_FORM_addr only. More...
 
DwarfCompileUnitgetCU () override
 
unsigned getOrCreateSourceID (const DIFile *File) override
 Look up the source ID for the given file. More...
 
void addImportedEntity (const DIImportedEntity *IE)
 
void addRange (RangeSpan Range)
 addRange - Add an address range to the list of ranges for this unit. More...
 
void attachLowHighPC (DIE &D, const MCSymbol *Begin, const MCSymbol *End)
 
DIEupdateSubprogramScopeDIE (const DISubprogram *SP)
 Find DIE for the given subprogram and attach appropriate DW_AT_low_pc and DW_AT_high_pc attributes. More...
 
void constructScopeDIE (LexicalScope *Scope, SmallVectorImpl< DIE * > &FinalChildren)
 
void addScopeRangeList (DIE &ScopeDIE, SmallVector< RangeSpan, 2 > Range)
 A helper function to construct a RangeSpanList for a given lexical scope. More...
 
void attachRangesOrLowHighPC (DIE &D, SmallVector< RangeSpan, 2 > Ranges)
 
void attachRangesOrLowHighPC (DIE &D, const SmallVectorImpl< InsnRange > &Ranges)
 
DIEconstructInlinedScopeDIE (LexicalScope *Scope)
 This scope represents inlined body of a function. More...
 
DIEconstructLexicalScopeDIE (LexicalScope *Scope)
 Construct new DW_TAG_lexical_block for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels. More...
 
DIEconstructVariableDIE (DbgVariable &DV, bool Abstract=false)
 constructVariableDIE - Construct a DIE for the given DbgVariable. More...
 
DIEconstructVariableDIE (DbgVariable &DV, const LexicalScope &Scope, DIE *&ObjectPointer)
 
DIEconstructLabelDIE (DbgLabel &DL, const LexicalScope &Scope)
 Construct a DIE for the given DbgLabel. More...
 
DIEcreateScopeChildrenDIE (LexicalScope *Scope, SmallVectorImpl< DIE * > &Children, bool *HasNonScopeChildren=nullptr)
 A helper function to create children of a Scope DIE. More...
 
void createBaseTypeDIEs ()
 
DIEconstructSubprogramScopeDIE (const DISubprogram *Sub, LexicalScope *Scope)
 Construct a DIE for this subprogram scope. More...
 
DIEcreateAndAddScopeChildren (LexicalScope *Scope, DIE &ScopeDIE)
 
void constructAbstractSubprogramScopeDIE (LexicalScope *Scope)
 
bool useGNUAnalogForDwarf5Feature () const
 Whether to use the GNU analog for a DWARF5 tag, attribute, or location atom. More...
 
dwarf::Tag getDwarf5OrGNUTag (dwarf::Tag Tag) const
 This takes a DWARF 5 tag and returns it or a GNU analog. More...
 
dwarf::Attribute getDwarf5OrGNUAttr (dwarf::Attribute Attr) const
 This takes a DWARF 5 attribute and returns it or a GNU analog. More...
 
dwarf::LocationAtom getDwarf5OrGNULocationAtom (dwarf::LocationAtom Loc) const
 This takes a DWARF 5 location atom and either returns it or a GNU analog. More...
 
DIEconstructCallSiteEntryDIE (DIE &ScopeDIE, const DISubprogram *CalleeSP, bool IsTail, const MCSymbol *PCAddr, const MCSymbol *CallAddr, unsigned CallReg)
 Construct a call site entry DIE describing a call within Scope to a callee described by CalleeSP. More...
 
void constructCallSiteParmEntryDIEs (DIE &CallSiteDIE, SmallVector< DbgCallSiteParam, 4 > &Params)
 Construct call site parameter DIEs for the CallSiteDIE. More...
 
DIEconstructImportedEntityDIE (const DIImportedEntity *Module)
 Construct import_module DIE. More...
 
void finishSubprogramDefinition (const DISubprogram *SP)
 
void finishEntityDefinition (const DbgEntity *Entity)
 
DbgEntitygetExistingAbstractEntity (const DINode *Node)
 
void createAbstractEntity (const DINode *Node, LexicalScope *Scope)
 
void setSkeleton (DwarfCompileUnit &Skel)
 Set the skeleton unit associated with this unit. More...
 
unsigned getHeaderSize () const override
 Compute the size of a header for this unit, not including the initial length field. More...
 
unsigned getLength ()
 
void emitHeader (bool UseOffsets) override
 Emit the header for this unit, not including the initial length field. More...
 
void addAddrTableBase ()
 Add the DW_AT_addr_base attribute to the unit DIE. More...
 
MCSymbolgetLabelBegin () const
 
MCSymbolgetMacroLabelBegin () const
 
void addGlobalName (StringRef Name, const DIE &Die, const DIScope *Context) override
 Add a new global name to the compile unit. More...
 
void addGlobalNameForTypeUnit (StringRef Name, const DIScope *Context)
 Add a new global name present in a type unit to this 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...
 
void addGlobalTypeUnitType (const DIType *Ty, const DIScope *Context)
 Add a new global type present in a type unit to this compile unit. More...
 
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. More...
 
void addAddress (DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
 Add an address attribute to a die based on the location provided. More...
 
void addComplexAddress (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 variable (navigating the extra location information encoded in the type) based on the starting location. More...
 
void addLocationList (DIE &Die, dwarf::Attribute Attribute, unsigned Index)
 Add a Dwarf loclistptr attribute data and value. More...
 
void applyVariableAttributes (const DbgVariable &Var, DIE &VariableDie)
 
void addExpr (DIELoc &Die, dwarf::Form Form, const MCExpr *Expr)
 Add a Dwarf expression attribute data and value. More...
 
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. More...
 
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)
 
- Public Member Functions inherited from llvm::DwarfUnit
AsmPrintergetAsmPrinter () const
 
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. 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 insertDIE (DIE *D)
 
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...
 
void 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 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. 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 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. 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 ConstantInt *CI, const DIType *Ty)
 Add constant value entry in variable DIE. More...
 
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. More...
 
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 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)
 
DIEcreateTypeDIE (const DIScope *Context, DIE &ContextDIE, const DIType *Ty)
 Creates type DIE with specific context. More...
 
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 (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. 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 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. More...
 
void addSectionLabel (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label, const MCSymbol *Sec)
 Add a Dwarf section label attribute data and value. More...
 
void addAnnotation (DIE &Buffer, DINodeArray Annotations)
 Add DW_TAG_LLVM_annotation. More...
 
DIEcreateTypeDIE (const DICompositeType *Ty)
 Get context owner's DIE. More...
 
- 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. More...
 
MCSectiongetSection () const
 Return the section that this DIEUnit will be emitted into. More...
 
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)
 
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. More...
 
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. 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
virtual ~DIEUnit ()=default
 .debug_info or .debug_types absolute section offset. 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 47 of file DwarfCompileUnit.h.

Member Typedef Documentation

◆ InlinedEntity

Find abstract variable associated with Var.

Definition at line 275 of file DwarfCompileUnit.h.

Constructor & Destructor Documentation

◆ DwarfCompileUnit()

DwarfCompileUnit::DwarfCompileUnit ( unsigned  UID,
const DICompileUnit Node,
AsmPrinter A,
DwarfDebug DW,
DwarfFile DWU,
UnitKind  Kind = UnitKind::Full 
)

Definition at line 58 of file DwarfCompileUnit.cpp.

Member Function Documentation

◆ addAddress()

void DwarfCompileUnit::addAddress ( DIE Die,
dwarf::Attribute  Attribute,
const MachineLocation Location 
)

◆ addAddrTableBase()

void DwarfCompileUnit::addAddrTableBase ( )

◆ addBaseTypeRef()

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

◆ addComplexAddress()

void DwarfCompileUnit::addComplexAddress ( 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 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 1454 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::MachineLocation::getReg(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::DbgVariable::getSingleExpression(), llvm::MachineFunction::getSubtarget(), llvm::DIExpression::isEntryValue(), llvm::AsmPrinter::MF, move, 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 1519 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 1379 of file DwarfCompileUnit.cpp.

References Context, 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 1387 of file DwarfCompileUnit.cpp.

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

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

◆ addGlobalType()

void DwarfCompileUnit::addGlobalType ( 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 1400 of file DwarfCompileUnit.cpp.

References Context, llvm::DIType::getName(), llvm::DwarfUnit::getParentContextString(), hasDwarfPubSections(), and llvm::StringRef::str().

◆ 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 1408 of file DwarfCompileUnit.cpp.

References Context, llvm::DIType::getName(), llvm::DwarfUnit::getParentContextString(), llvm::DIEUnit::getUnitDie(), hasDwarfPubSections(), move, and llvm::StringRef::str().

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

◆ addImportedEntity()

void llvm::DwarfCompileUnit::addImportedEntity ( const DIImportedEntity IE)
inline

Definition at line 172 of file DwarfCompileUnit.h.

References assert(), and llvm::ARM_PROC::IE.

◆ addLabelAddress()

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

◆ 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 108 of file DwarfCompileUnit.cpp.

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

Referenced by addLabelAddress().

◆ addLocationAttribute()

void DwarfCompileUnit::addLocationAttribute ( DIE ToDIE,
const DIGlobalVariable GV,
ArrayRef< GlobalExpr GlobalExprs 
)

◆ addLocationList()

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

◆ addRange()

void DwarfCompileUnit::addRange ( RangeSpan  Range)

◆ addScopeRangeList()

void DwarfCompileUnit::addScopeRangeList ( DIE ScopeDIE,
SmallVector< RangeSpan, 2 >  Range 
)

◆ 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 1420 of file DwarfCompileUnit.cpp.

References addAddress(), addComplexAddress(), and llvm::DbgVariable::hasComplexAddress().

◆ applyLabelAttributes()

void DwarfCompileUnit::applyLabelAttributes ( const DbgLabel Label,
DIE LabelDie 
)

◆ applyStmtList()

void DwarfCompileUnit::applyStmtList ( DIE D)

◆ applySubprogramAttributesToDefinition()

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

◆ applyVariableAttributes()

void DwarfCompileUnit::applyVariableAttributes ( const DbgVariable Var,
DIE VariableDie 
)

◆ attachLowHighPC()

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

Definition at line 399 of file DwarfCompileUnit.cpp.

Referenced by attachRangesOrLowHighPC().

◆ attachRangesOrLowHighPC() [1/2]

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

◆ attachRangesOrLowHighPC() [2/2]

void DwarfCompileUnit::attachRangesOrLowHighPC ( DIE D,
SmallVector< RangeSpan, 2 >  Ranges 
)

◆ constructAbstractSubprogramScopeDIE()

void DwarfCompileUnit::constructAbstractSubprogramScopeDIE ( LexicalScope Scope)

◆ constructCallSiteEntryDIE()

DIE & DwarfCompileUnit::constructCallSiteEntryDIE ( DIE ScopeDIE,
const DISubprogram CalleeSP,
bool  IsTail,
const MCSymbol PCAddr,
const MCSymbol CallAddr,
unsigned  CallReg 
)

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

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 1167 of file DwarfCompileUnit.cpp.

References addAddress(), llvm::DwarfUnit::addDIEEntry(), llvm::DwarfUnit::addFlag(), addLabelAddress(), assert(), llvm::DwarfUnit::createAndAddDIE(), getDwarf5OrGNUAttr(), getDwarf5OrGNUTag(), llvm::DwarfUnit::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 1223 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(), Param, and llvm::DwarfExpression::setCallSiteParamValueFlag().

◆ constructImportedEntityDIE()

DIE * DwarfCompileUnit::constructImportedEntityDIE ( const DIImportedEntity Module)

◆ constructInlinedScopeDIE()

DIE * DwarfCompileUnit::constructInlinedScopeDIE ( LexicalScope Scope)

◆ 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 679 of file DwarfCompileUnit.cpp.

References attachRangesOrLowHighPC(), llvm::DwarfUnit::DD, llvm::DwarfUnit::DIEValueAllocator, llvm::DIE::get(), and llvm::DwarfDebug::isLexicalScopeDIENull().

Referenced by constructScopeDIE().

◆ constructScopeDIE()

void DwarfCompileUnit::constructScopeDIE ( LexicalScope Scope,
SmallVectorImpl< DIE * > &  FinalChildren 
)

◆ constructSubprogramScopeDIE()

DIE & DwarfCompileUnit::constructSubprogramScopeDIE ( const DISubprogram Sub,
LexicalScope Scope 
)

◆ constructVariableDIE() [1/2]

DIE * DwarfCompileUnit::constructVariableDIE ( DbgVariable DV,
bool  Abstract = false 
)

constructVariableDIE - Construct a DIE for the given DbgVariable.

Definition at line 693 of file DwarfCompileUnit.cpp.

References D, and llvm::DbgEntity::setDIE().

Referenced by constructVariableDIE(), and createScopeChildrenDIE().

◆ constructVariableDIE() [2/2]

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

◆ createAbstractEntity()

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

Definition at line 1331 of file DwarfCompileUnit.cpp.

◆ createAndAddScopeChildren()

DIE * DwarfCompileUnit::createAndAddScopeChildren ( LexicalScope Scope,
DIE ScopeDIE 
)

◆ createBaseTypeDIEs()

void DwarfCompileUnit::createBaseTypeDIEs ( )

◆ createScopeChildrenDIE()

DIE * DwarfCompileUnit::createScopeChildrenDIE ( LexicalScope Scope,
SmallVectorImpl< DIE * > &  Children,
bool *  HasNonScopeChildren = nullptr 
)

◆ emitHeader()

void DwarfCompileUnit::emitHeader ( bool  UseOffsets)
overridevirtual

◆ finishEntityDefinition()

void DwarfCompileUnit::finishEntityDefinition ( const DbgEntity Entity)

◆ finishSubprogramDefinition()

void DwarfCompileUnit::finishSubprogramDefinition ( const DISubprogram SP)

◆ getBaseAddress()

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

Definition at line 358 of file DwarfCompileUnit.h.

◆ getCU()

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

Implements llvm::DwarfUnit.

Definition at line 168 of file DwarfCompileUnit.h.

Referenced by getOrCreateCommonBlock().

◆ 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 1134 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 1156 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 1120 of file DwarfCompileUnit.cpp.

References llvm_unreachable, and useGNUAnalogForDwarf5Feature().

Referenced by constructCallSiteEntryDIE(), and constructCallSiteParmEntryDIEs().

◆ getDWOId()

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

Definition at line 360 of file DwarfCompileUnit.h.

Referenced by emitHeader().

◆ getExistingAbstractEntity()

DbgEntity * DwarfCompileUnit::getExistingAbstractEntity ( const DINode Node)

Definition at line 1323 of file DwarfCompileUnit.cpp.

Referenced by finishEntityDefinition().

◆ getGlobalNames()

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

Definition at line 322 of file DwarfCompileUnit.h.

◆ getGlobalTypes()

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

Definition at line 323 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 282 of file DwarfCompileUnit.h.

References llvm::DwarfUnit::DD, llvm::DwarfDebug::getDwarfVersion(), llvm::DwarfUnit::getHeaderSize(), and llvm::DwarfDebug::useSplitDwarf().

Referenced by getLength().

◆ getLabelBegin()

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

Definition at line 299 of file DwarfCompileUnit.h.

References assert().

Referenced by llvm::emitDWARF5AccelTable().

◆ getLength()

unsigned llvm::DwarfCompileUnit::getLength ( )
inline

◆ getLineTableStartSym()

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

Get line table start symbol for this unit.

Definition at line 129 of file DwarfCompileUnit.h.

◆ getMacroLabelBegin()

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

Definition at line 304 of file DwarfCompileUnit.h.

◆ getOrCreateCommonBlock()

DIE * DwarfCompileUnit::getOrCreateCommonBlock ( const DICommonBlock CB,
ArrayRef< GlobalExpr GlobalExprs 
)

◆ getOrCreateGlobalVariableDIE()

DIE * DwarfCompileUnit::getOrCreateGlobalVariableDIE ( const DIGlobalVariable GV,
ArrayRef< GlobalExpr GlobalExprs 
)

◆ 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 120 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::Asm, llvm::DwarfUnit::DD, File, llvm::DwarfDebug::getMD5AsBytes(), getUniqueID(), llvm::None, and llvm::AsmPrinter::OutStreamer.

Referenced by constructInlinedScopeDIE().

◆ getRanges()

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

getRanges - Get the list of ranges for this unit.

Definition at line 354 of file DwarfCompileUnit.h.

◆ getSkeleton()

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

Definition at line 117 of file DwarfCompileUnit.h.

References llvm::Skeleton.

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

◆ getUniqueID()

unsigned llvm::DwarfCompileUnit::getUniqueID ( ) const
inline

Definition at line 115 of file DwarfCompileUnit.h.

Referenced by getOrCreateSourceID(), and initStmtList().

◆ hasDwarfPubSections()

bool DwarfCompileUnit::hasDwarfPubSections ( ) const

◆ hasRangeLists()

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

Definition at line 114 of file DwarfCompileUnit.h.

◆ includeMinimalInlineScopes()

bool DwarfCompileUnit::includeMinimalInlineScopes ( ) const

◆ initStmtList()

void DwarfCompileUnit::initStmtList ( )

◆ setBaseAddress()

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

Definition at line 357 of file DwarfCompileUnit.h.

References llvm::sampleprof::Base.

◆ setDWOId()

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

Definition at line 361 of file DwarfCompileUnit.h.

◆ setSkeleton()

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

Set the skeleton unit associated with this unit.

Definition at line 280 of file DwarfCompileUnit.h.

References llvm::Skeleton.

◆ takeRanges()

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

Definition at line 355 of file DwarfCompileUnit.h.

References move.

◆ updateSubprogramScopeDIE()

DIE & DwarfCompileUnit::updateSubprogramScopeDIE ( const DISubprogram SP)

Find DIE for the given subprogram and attach appropriate DW_AT_low_pc and DW_AT_high_pc attributes.

If there are global variables in this scope then create and insert DIEs for these variables.

Definition at line 416 of file DwarfCompileUnit.cpp.

References addAddress(), llvm::DwarfDebug::addArangeLabel(), llvm::DwarfUnit::addBlock(), llvm::DwarfExpression::addExpression(), llvm::DwarfUnit::addFlag(), llvm::DwarfUnit::addLabel(), llvm::DwarfUnit::addSInt(), llvm::DwarfDebug::addSubprogramNames(), llvm::DwarfUnit::addUInt(), llvm::DwarfExpression::addWasmLocation(), llvm::DwarfUnit::Asm, assert(), attachRangesOrLowHighPC(), llvm::TargetFrameLowering::DwarfFrameBase::CFA, llvm::DwarfUnit::CUNode, llvm::DwarfUnit::DD, llvm::DwarfUnit::DIEValueAllocator, llvm::TargetOptions::DisableFramePointerElim(), llvm::DIEDwarfExpression::finalize(), llvm::Triple::getArch(), llvm::DwarfDebug::getCurrentFunction(), llvm::TargetFrameLowering::getDwarfFrameBase(), llvm::AsmPrinter::GetExternalSymbolSymbol(), llvm::TargetSubtargetInfo::getFrameLowering(), llvm::DwarfUnit::getOrCreateSubprogramDIE(), llvm::MachineFunction::getSubtarget(), llvm::AsmPrinter::getSubtargetInfo(), llvm::MachineFunction::getTarget(), llvm::MCSubtargetInfo::getTargetTriple(), includeMinimalInlineScopes(), llvm::TargetFrameLowering::DwarfFrameBase::WasmFrameBase::Index, llvm::Register::isPhysicalRegister(), llvm::TargetFrameLowering::DwarfFrameBase::Kind, llvm::TargetFrameLowering::DwarfFrameBase::WasmFrameBase::Kind, llvm::TargetFrameLowering::DwarfFrameBase::Location, llvm::AsmPrinter::MBBSectionRanges, llvm::AsmPrinter::MF, move, llvm::TargetMachine::Options, llvm::TargetFrameLowering::DwarfFrameBase::Reg, llvm::TargetFrameLowering::DwarfFrameBase::Register, llvm::WebAssembly::TI_GLOBAL_RELOC, llvm::DwarfDebug::useAppleExtensionAttributes(), llvm::Triple::wasm64, llvm::wasm::WASM_SYMBOL_TYPE_GLOBAL, llvm::wasm::WASM_TYPE_I32, llvm::wasm::WASM_TYPE_I64, llvm::TargetFrameLowering::DwarfFrameBase::WasmFrameBase, and llvm::TargetFrameLowering::DwarfFrameBase::WasmLoc.

Referenced by constructSubprogramScopeDIE().

◆ 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 1116 of file DwarfCompileUnit.cpp.

References llvm::DwarfUnit::DD, llvm::DwarfDebug::getDwarfVersion(), and llvm::DwarfDebug::tuneForLLDB().

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

Member Data Documentation

◆ ExprRefedBaseTypes

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

Definition at line 145 of file DwarfCompileUnit.h.

Referenced by createBaseTypeDIEs().


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