LLVM 20.0.0git
|
#include "CodeGen/AsmPrinter/DwarfCompileUnit.h"
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 |
DwarfCompileUnit * | getSkeleton () const |
bool | includeMinimalInlineScopes () const |
void | initStmtList () |
void | applyStmtList (DIE &D) |
Apply the DW_AT_stmt_list from this compile unit to the specified DIE. | |
MCSymbol * | getLineTableStartSym () const |
Get line table start symbol for this unit. | |
DIE * | getOrCreateGlobalVariableDIE (const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs) |
Get or create global variable DIE. | |
DIE * | getOrCreateCommonBlock (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. | |
DwarfCompileUnit & | getCU () 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) |
DIE & | updateSubprogramScopeDIE (const DISubprogram *SP) |
Find DIE for the given subprogram and attach appropriate DW_AT_low_pc and DW_AT_high_pc 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) |
DIE * | constructInlinedScopeDIE (LexicalScope *Scope, DIE &ParentScopeDIE) |
This scope represents an inlined body of a function. | |
DIE * | constructLexicalScopeDIE (LexicalScope *Scope) |
Construct new DW_TAG_lexical_block for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels. | |
DIE * | getLexicalBlockDIE (const DILexicalBlock *LB) |
Get a DIE for the given DILexicalBlock. | |
DIE * | constructVariableDIE (DbgVariable &DV, bool Abstract=false) |
Construct a DIE for the given DbgVariable. | |
DIE * | 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. | |
DIE * | constructLabelDIE (DbgLabel &DL, const LexicalScope &Scope) |
Construct a DIE for the given DbgLabel. | |
void | createBaseTypeDIEs () |
DIE * | getOrCreateContextDIE (const DIScope *Ty) override |
Construct a DIE for a given scope. | |
DIE & | constructSubprogramScopeDIE (const DISubprogram *Sub, LexicalScope *Scope) |
Construct a DIE for this subprogram scope. | |
DIE * | createAndAddScopeChildren (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. | |
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. | |
DIE & | 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 . | |
void | constructCallSiteParmEntryDIEs (DIE &CallSiteDIE, SmallVector< DbgCallSiteParam, 4 > &Params) |
Construct call site parameter DIEs for the CallSiteDIE . | |
DIE * | getOrCreateImportedEntityDIE (const DIImportedEntity *IE) |
Get or create a DIE for an imported entity. | |
DIE * | constructImportedEntityDIE (const DIImportedEntity *IE) |
void | finishSubprogramDefinition (const DISubprogram *SP) |
void | finishEntityDefinition (const DbgEntity *Entity) |
DbgEntity * | getExistingAbstractEntity (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. | |
MCSymbol * | getMacroLabelBegin () 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 MCSymbol * | getBaseAddress () const |
uint64_t | getDWOId () const |
void | setDWOId (uint64_t DwoId) |
bool | hasDwarfPubSections () const |
void | addBaseTypeRef (DIEValueList &Die, int64_t Idx) |
MDNodeSetVector & | getDeferredLocalDecls () |
Public Member Functions inherited from llvm::DwarfUnit | |
unsigned | getUniqueID () const |
Gets Unique ID for this unit. | |
AsmPrinter * | getAsmPrinter () const |
MCSymbol * | getLabelBegin () const |
Get the the symbol for start of the section for this unit. | |
MCSymbol * | getEndLabel () const |
uint16_t | getLanguage () const |
const DICompileUnit * | getCUNode () const |
DwarfDebug & | getDwarfDebug () 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 | addGlobalTypeImpl (const DIType *Ty, const DIE &Die, const DIScope *Context)=0 |
Add a new global type to the compile unit. | |
void | addGlobalType (const DIType *Ty, const DIE &Die, const DIScope *Context) |
DIE * | getDIE (const DINode *D) const |
Returns the DIE map slot for the specified debug variable. | |
DIELoc * | getDIELoc () |
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. | |
DIE * | getOrCreateNameSpace (const DINamespace *NS) |
DIE * | getOrCreateModule (const DIModule *M) |
DIE * | getOrCreateSubprogramDIE (const DISubprogram *SP, bool Minimal=false) |
void | applySubprogramAttributes (const DISubprogram *SP, DIE &SPDie, bool SkipSPAttributes=false) |
DIE * | createTypeDIE (const DIScope *Context, DIE &ContextDIE, const DIType *Ty) |
Creates type DIE with specific context. | |
virtual DIE * | getOrCreateTypeDIE (const MDNode *TyNode) |
Find existing DIE or create new DIE for the given type. | |
virtual DIE * | getOrCreateContextDIE (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. | |
DIE & | createAndAddDIE (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 DwarfCompileUnit & | getCU ()=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. | |
DIE * | createTypeDIE (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 MCSymbol * | getCrossSectionRelativeBaseAddress () const |
MCSection * | getSection () const |
Return the section that this DIEUnit will be emitted into. | |
void | setDebugSectionOffset (uint64_t O) |
uint64_t | getDebugSectionOffset () const |
DIE & | getUnitDie () |
const DIE & | getUnitDie () const |
Public Attributes | |
std::vector< BaseTypeRef > | ExprRefedBaseTypes |
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 () | |
DIE * | getOrCreateStaticMemberDIE (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 DICompileUnit * | CUNode |
MDNode for the compile unit. | |
BumpPtrAllocator | DIEValueAllocator |
AsmPrinter * | Asm |
Target of Dwarf emission. | |
MCSymbol * | LabelBegin = nullptr |
The start of the unit within its section. | |
MCSymbol * | EndLabel = nullptr |
Emitted at the end of the CU and used to compute the CU Length field. | |
DwarfDebug * | DD |
DwarfFile * | DU |
DIE * | IndexTyDie = 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. | |
Definition at line 45 of file DwarfCompileUnit.h.
Find abstract variable associated with Var.
Definition at line 302 of file DwarfCompileUnit.h.
DwarfCompileUnit::DwarfCompileUnit | ( | unsigned | UID, |
const DICompileUnit * | Node, | ||
AsmPrinter * | A, | ||
DwarfDebug * | DW, | ||
DwarfFile * | DWU, | ||
UnitKind | Kind = UnitKind::Full |
||
) |
Definition at line 73 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::Asm, llvm::AsmPrinter::createTempSymbol(), llvm::DIEUnit::getUnitDie(), and llvm::DwarfUnit::insertDIE().
void DwarfCompileUnit::addAddress | ( | DIE & | Die, |
dwarf::Attribute | Attribute, | ||
const MachineLocation & | Location | ||
) |
Add an address attribute to a die based on the location provided.
Definition at line 1572 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addBlock(), llvm::DwarfExpression::addExpression(), llvm::DwarfExpression::addMachineRegExpression(), llvm::DwarfUnit::addUInt(), llvm::DwarfUnit::Asm, llvm::DwarfUnit::DIEValueAllocator, llvm::DIEDwarfExpression::finalize(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::AsmPrinter::MF, llvm::DwarfExpression::setMemoryLocationKind(), llvm::DwarfExpression::TagOffset, and TRI.
Referenced by addVariableAddress(), constructCallSiteEntryDIE(), constructCallSiteParmEntryDIEs(), and updateSubprogramScopeDIE().
void DwarfCompileUnit::addAddrTableBase | ( | ) |
Add the DW_AT_addr_base attribute to the unit DIE.
Definition at line 1687 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addSectionLabel(), llvm::DwarfUnit::Asm, llvm::DwarfUnit::DD, llvm::DwarfDebug::getAddressPool(), llvm::MCSection::getBeginSymbol(), llvm::MCObjectFileInfo::getDwarfAddrSection(), llvm::DwarfDebug::getDwarfVersion(), llvm::AddressPool::getLabel(), llvm::AsmPrinter::getObjFileLowering(), and llvm::DIEUnit::getUnitDie().
void DwarfCompileUnit::addBaseTypeRef | ( | DIEValueList & | Die, |
int64_t | Idx | ||
) |
Definition at line 1696 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addAttribute(), llvm::DwarfUnit::DIEValueAllocator, and Idx.
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 1597 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::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::DIExpression::isEntryValue(), llvm::AsmPrinter::MF, llvm::DwarfExpression::setLocation(), llvm::DwarfExpression::TagOffset, and TRI.
Referenced by addVariableAddress().
void DwarfCompileUnit::addExpr | ( | DIELoc & | Die, |
dwarf::Form | Form, | ||
const MCExpr * | Expr | ||
) |
Add a Dwarf expression attribute data and value.
Definition at line 1661 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addAttribute().
Referenced by addLocationAttribute().
|
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 1521 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::getParentContextString(), hasDwarfPubSections(), and Name.
Referenced by applySubprogramAttributesToDefinition(), getOrCreateCommonBlock(), and getOrCreateGlobalVariableDIE().
Add a new global name present in a type unit to this compile unit.
Definition at line 1529 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::getParentContextString(), llvm::DIEUnit::getUnitDie(), hasDwarfPubSections(), and Name.
Referenced by llvm::DwarfTypeUnit::addGlobalName().
|
overridevirtual |
Add a new global type to the compile unit.
Add a new global type to the unit.
Implements llvm::DwarfUnit.
Definition at line 1542 of file DwarfCompileUnit.cpp.
References llvm::DIType::getName(), llvm::DwarfUnit::getParentContextString(), hasDwarfPubSections(), and llvm::StringRef::str().
Add a new global type present in a type unit to this compile unit.
Definition at line 1550 of file DwarfCompileUnit.cpp.
References llvm::DIType::getName(), llvm::DwarfUnit::getParentContextString(), llvm::DIEUnit::getUnitDie(), hasDwarfPubSections(), and llvm::StringRef::str().
Referenced by llvm::DwarfTypeUnit::addGlobalTypeImpl().
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 83 of file DwarfCompileUnit.cpp.
References llvm::DwarfDebug::addArangeLabel(), llvm::DwarfUnit::addAttribute(), llvm::DwarfUnit::addBlock(), addLocalLabelAddress(), llvm::DwarfUnit::addPoolOpAddress(), assert(), llvm::sampleprof::Base, llvm::DwarfUnit::DD, llvm::DwarfUnit::DIEValueAllocator, llvm::DwarfDebug::getAddressPool(), llvm::DwarfDebug::getDwarfVersion(), llvm::AddressPool::getIndex(), llvm::DwarfDebug::getSectionLabel(), llvm::DwarfDebug::useAddrOffsetExpressions(), llvm::DwarfDebug::useAddrOffsetForm(), and llvm::DwarfDebug::useSplitDwarf().
Referenced by attachLowHighPC(), constructCallSiteEntryDIE(), and finishEntityDefinition().
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 123 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addAttribute().
Referenced by addLabelAddress().
void DwarfCompileUnit::addLocationAttribute | ( | DIE * | ToDIE, |
const DIGlobalVariable * | GV, | ||
ArrayRef< GlobalExpr > | GlobalExprs | ||
) |
Definition at line 218 of file DwarfCompileUnit.cpp.
References llvm::DwarfDebug::addAccelName(), llvm::DwarfDebug::addArangeLabel(), llvm::DwarfUnit::addBlock(), llvm::DwarfUnit::addConstantValue(), addExpr(), llvm::DwarfUnit::addLinkageName(), llvm::DwarfUnit::addOpAddress(), llvm::DwarfUnit::addSInt(), llvm::DwarfUnit::addUInt(), llvm::DwarfUnit::Asm, assert(), llvm::DwarfUnit::CUNode, llvm::DwarfUnit::DD, llvm::DwarfUnit::DIEValueAllocator, llvm::DIExpression::extractAddressClass(), llvm::DwarfDebug::getAddressPool(), llvm::MCAsmInfo::getCodePointerSize(), llvm::TargetLoweringObjectFile::getDebugThreadLocalSymbol(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::DIExpression::getElement(), llvm::AddressPool::getIndex(), llvm::TargetLoweringObjectFile::getIndirectSymViaRWPI(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::DIGlobalVariable::getLinkageName(), llvm::TargetMachine::getMCRegisterInfo(), llvm::DIVariable::getName(), llvm::DICompileUnit::getNameTableKind(), llvm::AsmPrinter::getObjFileLowering(), llvm::TargetMachine::getRelocationModel(), llvm::TargetLoweringObjectFile::getStaticBase(), llvm::AsmPrinter::getSymbol(), llvm::TargetMachine::getTargetTriple(), llvm::Global, llvm::DIExpression::isConstant(), llvm::Triple::isNVPTX(), llvm::SectionKind::isReadOnly(), llvm::Triple::isWasm(), llvm::AsmPrinter::MAI, llvm::Reloc::PIC_, llvm::Reloc::ROPI_RWPI, llvm::Reloc::RWPI, llvm::ArrayRef< T >::size(), llvm::TargetLoweringObjectFile::supportDebugThreadLocalLocation(), Sym, llvm::AsmPrinter::TM, llvm::DwarfDebug::tuneForGDB(), llvm::DIExpression::UnsignedConstant, llvm::DwarfDebug::useAllLinkageNames(), llvm::TargetMachine::useEmulatedTLS(), llvm::DwarfDebug::useGNUTLSOpcode(), and llvm::DwarfDebug::useSplitDwarf().
Referenced by getOrCreateCommonBlock(), and getOrCreateGlobalVariableDIE().
void DwarfCompileUnit::addLocationList | ( | DIE & | Die, |
dwarf::Attribute | Attribute, | ||
unsigned | Index | ||
) |
Add a Dwarf loclistptr attribute data and value.
Definition at line 1624 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addAttribute(), llvm::DwarfUnit::DD, llvm::DwarfDebug::getDwarfSectionOffsetForm(), and llvm::DwarfDebug::getDwarfVersion().
void DwarfCompileUnit::addRange | ( | RangeSpan | Range | ) |
addRange - Add an address range to the list of ranges for this unit.
Definition at line 414 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::DD, llvm::DwarfDebug::getPrevCU(), llvm::DwarfDebug::insertSectionLabel(), Range, llvm::DwarfDebug::setPrevCU(), and llvm::DwarfDebug::terminateLineTable().
Referenced by addScopeRangeList(), and llvm::DwarfDebug::endFunctionImpl().
void DwarfCompileUnit::addScopeRangeList | ( | DIE & | ScopeDIE, |
SmallVector< RangeSpan, 2 > | Range | ||
) |
A helper function to construct a RangeSpanList for a given lexical scope.
Definition at line 619 of file DwarfCompileUnit.cpp.
References addRange(), llvm::DwarfUnit::addSectionDelta(), llvm::DwarfUnit::addSectionLabel(), llvm::DwarfUnit::addUInt(), llvm::DwarfUnit::Asm, llvm::DwarfUnit::DD, llvm::DwarfUnit::DU, llvm::MCSection::getBeginSymbol(), llvm::MCObjectFileInfo::getDwarfRangesSection(), llvm::DwarfDebug::getDwarfVersion(), llvm::AsmPrinter::getObjFileLowering(), llvm::List, and Range.
Referenced by attachRangesOrLowHighPC().
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 1562 of file DwarfCompileUnit.cpp.
References addAddress(), and addComplexAddress().
void DwarfCompileUnit::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.
Definition at line 1632 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addAnnotation(), llvm::DwarfUnit::addFlag(), llvm::DwarfUnit::addSourceLine(), llvm::DwarfUnit::addString(), llvm::DwarfUnit::addType(), llvm::DwarfUnit::addUInt(), llvm::DbgVariable::getName(), llvm::DbgVariable::getType(), llvm::DbgVariable::getVariable(), llvm::DbgVariable::isArtificial(), and Name.
Referenced by constructVariableDIE(), and finishEntityDefinition().
Definition at line 1651 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addSourceLine(), llvm::DwarfUnit::addString(), and Name.
Referenced by constructLabelDIE(), and finishEntityDefinition().
void DwarfCompileUnit::applyStmtList | ( | DIE & | D | ) |
Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
Definition at line 458 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addSectionLabel(), llvm::DwarfUnit::Asm, D, llvm::MCSection::getBeginSymbol(), llvm::MCObjectFileInfo::getDwarfLineSection(), and llvm::AsmPrinter::getObjFileLowering().
void DwarfCompileUnit::applySubprogramAttributesToDefinition | ( | const DISubprogram * | SP, |
DIE & | SPDie | ||
) |
Definition at line 1666 of file DwarfCompileUnit.cpp.
References addGlobalName(), llvm::DwarfUnit::applySubprogramAttributes(), llvm::DIScope::getName(), llvm::DIScope::getScope(), and includeMinimalInlineScopes().
Referenced by constructAbstractSubprogramScopeDIE(), and finishSubprogramDefinition().
Definition at line 464 of file DwarfCompileUnit.cpp.
References addLabelAddress(), llvm::DwarfUnit::addLabelDelta(), assert(), D, llvm::DwarfUnit::DD, End, llvm::DwarfDebug::getDwarfVersion(), and llvm::MCSymbol::isDefined().
Referenced by attachRangesOrLowHighPC().
void DwarfCompileUnit::attachRangesOrLowHighPC | ( | DIE & | D, |
const SmallVectorImpl< InsnRange > & | Ranges | ||
) |
Definition at line 667 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::Asm, attachRangesOrLowHighPC(), llvm::DwarfUnit::DD, llvm::DwarfUnit::EndLabel, llvm::DebugHandlerBase::getLabelAfterInsn(), llvm::DebugHandlerBase::getLabelBeforeInsn(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::MachineBasicBlock::getSectionID(), llvm::MachineBasicBlock::isEndSection(), llvm::List, MBB, llvm::AsmPrinter::MBBSectionRanges, and llvm::MachineBasicBlock::sameSection().
void DwarfCompileUnit::attachRangesOrLowHighPC | ( | DIE & | D, |
SmallVector< RangeSpan, 2 > | Ranges | ||
) |
Definition at line 652 of file DwarfCompileUnit.cpp.
References addScopeRangeList(), llvm::DwarfDebug::alwaysUseRanges(), assert(), attachLowHighPC(), llvm::RangeSpan::Begin, llvm::DwarfUnit::DD, llvm::RangeSpan::End, llvm::DwarfDebug::getSectionLabel(), and llvm::DwarfDebug::useRangesSection().
Referenced by attachRangesOrLowHighPC(), constructInlinedScopeDIE(), constructLexicalScopeDIE(), and updateSubprogramScopeDIE().
void DwarfCompileUnit::constructAbstractSubprogramScopeDIE | ( | LexicalScope * | Scope | ) |
Definition at line 1167 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addDIEEntry(), llvm::DwarfUnit::addSInt(), applySubprogramAttributesToDefinition(), llvm::count(), llvm::DwarfUnit::createAndAddDIE(), createAndAddScopeChildren(), llvm::DwarfUnit::DD, llvm::dwarf::DW_INL_inlined, llvm::DwarfDebug::getDwarfVersion(), getOrCreateContextDIE(), llvm::DwarfUnit::getOrCreateSubprogramDIE(), llvm::DIEUnit::getUnitDie(), llvm::DIE::getUnitDie(), includeMinimalInlineScopes(), and llvm::DwarfDebug::lookupCU().
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 1261 of file DwarfCompileUnit.cpp.
References addAddress(), llvm::DwarfUnit::addDIEEntry(), llvm::DwarfUnit::addFlag(), addLabelAddress(), llvm::DwarfUnit::addLinkageName(), AddLinkageNamesToDeclCallOriginsForTuning(), assert(), llvm::DwarfUnit::createAndAddDIE(), llvm::DwarfUnit::DD, llvm::DIE::findAttribute(), getDwarf5OrGNUAttr(), getDwarf5OrGNUTag(), llvm::DwarfUnit::getOrCreateSubprogramDIE(), and useGNUAnalogForDwarf5Feature().
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 1323 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().
DIE * DwarfCompileUnit::constructImportedEntityDIE | ( | const DIImportedEntity * | IE | ) |
Definition at line 1347 of file DwarfCompileUnit.cpp.
References llvm::DwarfDebug::addAccelNamespace(), llvm::DIE::addChild(), llvm::DwarfUnit::addDIEEntry(), llvm::DwarfUnit::addSourceLine(), llvm::DwarfUnit::addString(), assert(), constructImportedEntityDIE(), llvm::DwarfUnit::CUNode, llvm::DwarfUnit::DD, llvm::DwarfUnit::DIEValueAllocator, llvm::DIE::get(), llvm::DwarfUnit::getDIE(), llvm::Module::getName(), llvm::DICompileUnit::getNameTableKind(), getOrCreateGlobalVariableDIE(), getOrCreateImportedEntityDIE(), llvm::DwarfUnit::getOrCreateModule(), llvm::DwarfUnit::getOrCreateNameSpace(), llvm::DwarfUnit::getOrCreateSubprogramDIE(), llvm::DwarfUnit::getOrCreateTypeDIE(), llvm::DwarfUnit::insertDIE(), lookup(), and Name.
Referenced by constructImportedEntityDIE(), and getOrCreateImportedEntityDIE().
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 701 of file DwarfCompileUnit.cpp.
References llvm::DIE::addChild(), llvm::DwarfUnit::addDIEEntry(), llvm::DwarfDebug::addSubprogramNames(), llvm::DwarfUnit::addUInt(), assert(), attachRangesOrLowHighPC(), llvm::DwarfUnit::CUNode, llvm::DwarfUnit::DD, llvm::DwarfUnit::DIEValueAllocator, llvm::DIE::get(), llvm::getDISubprogram(), llvm::DwarfDebug::getDwarfVersion(), llvm::DICompileUnit::getNameTableKind(), and getOrCreateSourceID().
Referenced by constructScopeDIE().
DIE * DwarfCompileUnit::constructLabelDIE | ( | DbgLabel & | DL, |
const LexicalScope & | Scope | ||
) |
Construct a DIE for the given DbgLabel.
Definition at line 976 of file DwarfCompileUnit.cpp.
References applyLabelAttributes(), llvm::DwarfUnit::DIEValueAllocator, DL, llvm::DIE::get(), and llvm::DwarfUnit::insertDIE().
Referenced by createAndAddScopeChildren().
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 738 of file DwarfCompileUnit.cpp.
References assert(), attachRangesOrLowHighPC(), llvm::count(), llvm::DwarfUnit::DD, llvm::DwarfUnit::DIEValueAllocator, llvm::DIE::get(), and llvm::DwarfDebug::isLexicalScopeDIENull().
Referenced by constructScopeDIE().
void DwarfCompileUnit::constructScopeDIE | ( | LexicalScope * | Scope, |
DIE & | ParentScopeDIE | ||
) |
Definition at line 587 of file DwarfCompileUnit.cpp.
References llvm::DIE::addChild(), assert(), constructInlinedScopeDIE(), constructLexicalScopeDIE(), createAndAddScopeChildren(), llvm::DwarfUnit::DD, and llvm::DwarfDebug::isLexicalScopeDIENull().
Referenced by createAndAddScopeChildren().
DIE & DwarfCompileUnit::constructSubprogramScopeDIE | ( | const DISubprogram * | Sub, |
LexicalScope * | Scope | ||
) |
Construct a DIE for this subprogram scope.
Definition at line 1091 of file DwarfCompileUnit.cpp.
References llvm::DIE::addChild(), llvm::DwarfUnit::addDIEEntry(), assert(), createAndAddScopeChildren(), llvm::DwarfUnit::DIEValueAllocator, llvm::DIE::get(), includeMinimalInlineScopes(), llvm::DITypeRefArray::size(), and updateSubprogramScopeDIE().
Referenced by llvm::DwarfDebug::endFunctionImpl().
DIE * DwarfCompileUnit::constructVariableDIE | ( | DbgVariable & | DV, |
bool | Abstract = false |
||
) |
Construct a DIE for the given DbgVariable.
Definition at line 761 of file DwarfCompileUnit.cpp.
References applyCommonDbgVariableAttributes(), llvm::DbgVariable::asVariant(), llvm::DwarfUnit::DIEValueAllocator, llvm::DIE::get(), llvm::DbgVariable::getTag(), llvm::DbgVariable::getVariable(), llvm::DwarfUnit::insertDIE(), and llvm::DbgEntity::setDIE().
Referenced by constructVariableDIE(), and createAndAddScopeChildren().
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 967 of file DwarfCompileUnit.cpp.
References constructVariableDIE(), and llvm::DbgVariable::isObjectPointer().
void DwarfCompileUnit::createAbstractEntity | ( | const DINode * | Node, |
LexicalScope * | Scope | ||
) |
Definition at line 1471 of file DwarfCompileUnit.cpp.
References llvm::DwarfFile::addScopeLabel(), llvm::DwarfFile::addScopeVariable(), assert(), and llvm::DwarfUnit::DU.
Referenced by llvm::DwarfDebug::endFunctionImpl().
DIE * DwarfCompileUnit::createAndAddScopeChildren | ( | LexicalScope * | Scope, |
DIE & | ScopeDIE | ||
) |
Definition at line 1119 of file DwarfCompileUnit.cpp.
References llvm::DIE::addChild(), constructLabelDIE(), constructScopeDIE(), constructVariableDIE(), createAndAddScopeChildren(), llvm::DwarfUnit::DD, DL, llvm::DwarfUnit::DU, llvm::SetVector< T, Vector, Set, N >::empty(), llvm::DwarfDebug::getLocalDeclsForScope(), llvm::DwarfFile::getScopeLabels(), llvm::DwarfFile::getScopeVariables(), includeMinimalInlineScopes(), llvm::SetVector< T, Vector, Set, N >::insert(), and sortLocalVars().
Referenced by constructAbstractSubprogramScopeDIE(), constructScopeDIE(), constructSubprogramScopeDIE(), and createAndAddScopeChildren().
void DwarfCompileUnit::createBaseTypeDIEs | ( | ) |
Definition at line 1701 of file DwarfCompileUnit.cpp.
References llvm::DIE::addChildFront(), llvm::DwarfUnit::addString(), llvm::DwarfUnit::addUInt(), llvm::dwarf::AttributeEncodingString(), llvm::DwarfUnit::DIEValueAllocator, llvm::divideCeil(), ExprRefedBaseTypes, llvm::DIE::get(), llvm::DIEUnit::getUnitDie(), llvm::reverse(), and llvm::Twine::toStringRef().
|
overridevirtual |
Emit the header for this unit, not including the initial length field.
Implements llvm::DwarfUnit.
Definition at line 1486 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::Asm, llvm::AsmPrinter::createTempSymbol(), llvm::DwarfUnit::DD, llvm::DwarfUnit::emitCommonHeader(), llvm::AsmPrinter::emitInt64(), llvm::DwarfDebug::getDwarfVersion(), getDWOId(), llvm::DwarfUnit::LabelBegin, llvm::AsmPrinter::OutStreamer, llvm::DwarfDebug::useSectionsAsReferences(), and llvm::DwarfDebug::useSplitDwarf().
Label may be used to generate DW_AT_low_pc, so put it outside if/else block.
Definition at line 1430 of file DwarfCompileUnit.cpp.
References llvm::DwarfDebug::addAccelName(), llvm::DwarfUnit::addDIEEntry(), addLabelAddress(), applyCommonDbgVariableAttributes(), applyLabelAttributes(), llvm::DwarfUnit::CUNode, llvm::DbgEntity::getDIE(), llvm::DwarfUnit::getDwarfDebug(), llvm::DbgEntity::getEntity(), getExistingAbstractEntity(), llvm::DICompileUnit::getNameTableKind(), llvm_unreachable, Name, and Sym.
void DwarfCompileUnit::finishSubprogramDefinition | ( | const DISubprogram * | SP | ) |
Definition at line 1416 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addDIEEntry(), applySubprogramAttributesToDefinition(), assert(), D, llvm::DwarfUnit::getDIE(), includeMinimalInlineScopes(), and lookup().
Definition at line 384 of file DwarfCompileUnit.h.
|
inlineoverridevirtual |
Implements llvm::DwarfUnit.
Definition at line 200 of file DwarfCompileUnit.h.
Referenced by getOrCreateCommonBlock().
|
inline |
Definition at line 393 of file DwarfCompileUnit.h.
dwarf::Attribute DwarfCompileUnit::getDwarf5OrGNUAttr | ( | dwarf::Attribute | Attr | ) | const |
This takes a DWARF 5 attribute and returns it or a GNU analog.
Definition at line 1228 of file DwarfCompileUnit.cpp.
References llvm_unreachable, and useGNUAnalogForDwarf5Feature().
Referenced by constructCallSiteEntryDIE(), and constructCallSiteParmEntryDIEs().
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 1250 of file DwarfCompileUnit.cpp.
References llvm_unreachable, and useGNUAnalogForDwarf5Feature().
dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUTag | ( | dwarf::Tag | Tag | ) | const |
This takes a DWARF 5 tag and returns it or a GNU analog.
Definition at line 1214 of file DwarfCompileUnit.cpp.
References llvm_unreachable, and useGNUAnalogForDwarf5Feature().
Referenced by constructCallSiteEntryDIE(), and constructCallSiteParmEntryDIEs().
|
inline |
Definition at line 386 of file DwarfCompileUnit.h.
Referenced by emitHeader().
Definition at line 1463 of file DwarfCompileUnit.cpp.
References I.
Referenced by llvm::DwarfDebug::endFunctionImpl(), and finishEntityDefinition().
Definition at line 344 of file DwarfCompileUnit.h.
Definition at line 345 of file DwarfCompileUnit.h.
|
inlineoverridevirtual |
Compute the size of a header for this unit, not including the initial length field.
Reimplemented from llvm::DwarfUnit.
Definition at line 309 of file DwarfCompileUnit.h.
References llvm::DwarfUnit::DD, llvm::DwarfDebug::getDwarfVersion(), llvm::DwarfUnit::getHeaderSize(), and llvm::DwarfDebug::useSplitDwarf().
Referenced by getLength().
|
inline |
Definition at line 316 of file DwarfCompileUnit.h.
References llvm::DwarfUnit::Asm, getHeaderSize(), llvm::DIE::getSize(), llvm::DIEUnit::getUnitDie(), and llvm::AsmPrinter::getUnitLengthFieldByteSize().
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 1722 of file DwarfCompileUnit.cpp.
References assert(), llvm::count(), and llvm::DILocalScope::getSubprogram().
Referenced by getOrCreateContextDIE().
|
inline |
Get line table start symbol for this unit.
Definition at line 161 of file DwarfCompileUnit.h.
|
inline |
Definition at line 326 of file DwarfCompileUnit.h.
DIE * DwarfCompileUnit::getOrCreateCommonBlock | ( | const DICommonBlock * | CB, |
ArrayRef< GlobalExpr > | GlobalExprs | ||
) |
Definition at line 397 of file DwarfCompileUnit.cpp.
References addGlobalName(), addLocationAttribute(), llvm::DwarfUnit::addSourceLine(), llvm::DwarfUnit::addString(), llvm::DwarfUnit::createAndAddDIE(), llvm::StringRef::empty(), getCU(), llvm::DICommonBlock::getDecl(), llvm::DwarfUnit::getDIE(), llvm::DICommonBlock::getFile(), llvm::DICommonBlock::getLineNo(), llvm::DICommonBlock::getName(), getOrCreateContextDIE(), llvm::DICommonBlock::getScope(), and Name.
Referenced by getOrCreateGlobalVariableDIE().
Construct a DIE for a given scope.
This instance of 'getOrCreateContextDIE()' can handle DILocalScope.
Reimplemented from llvm::DwarfUnit.
Definition at line 1733 of file DwarfCompileUnit.cpp.
References llvm::count(), getLexicalBlockDIE(), and llvm::DwarfUnit::getOrCreateContextDIE().
Referenced by constructAbstractSubprogramScopeDIE(), getOrCreateCommonBlock(), getOrCreateGlobalVariableDIE(), and getOrCreateImportedEntityDIE().
DIE * DwarfCompileUnit::getOrCreateGlobalVariableDIE | ( | const DIGlobalVariable * | GV, |
ArrayRef< GlobalExpr > | GlobalExprs | ||
) |
Get or create global variable DIE.
Definition at line 152 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addAnnotation(), llvm::DwarfUnit::addDIEEntry(), llvm::DwarfUnit::addFlag(), addGlobalName(), addLocationAttribute(), llvm::DwarfUnit::addSourceLine(), llvm::DwarfUnit::addString(), llvm::DwarfUnit::addTemplateParams(), llvm::DwarfUnit::addType(), llvm::DwarfUnit::addUInt(), assert(), llvm::DwarfUnit::createAndAddDIE(), llvm::StringRef::empty(), llvm::DIVariable::getAlignInBytes(), llvm::DIGlobalVariable::getAnnotations(), llvm::DwarfUnit::getDIE(), llvm::DIGlobalVariable::getDisplayName(), llvm::DIVariable::getName(), getOrCreateCommonBlock(), getOrCreateContextDIE(), llvm::DwarfUnit::getOrCreateStaticMemberDIE(), llvm::DIVariable::getScope(), llvm::DIGlobalVariable::getStaticDataMemberDeclaration(), llvm::DINode::getTag(), llvm::DIGlobalVariable::getTemplateParams(), llvm::DIVariable::getType(), llvm::DIGlobalVariable::isDefinition(), and llvm::DIGlobalVariable::isLocalToUnit().
Referenced by constructImportedEntityDIE().
DIE * DwarfCompileUnit::getOrCreateImportedEntityDIE | ( | const DIImportedEntity * | IE | ) |
Get or create a DIE for an imported entity.
Definition at line 1401 of file DwarfCompileUnit.cpp.
References llvm::DIE::addChild(), assert(), constructImportedEntityDIE(), llvm::DwarfUnit::getDIE(), and getOrCreateContextDIE().
Referenced by constructImportedEntityDIE().
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 132 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::Asm, llvm::DwarfUnit::DD, llvm::DwarfDebug::getMD5AsBytes(), llvm::DwarfUnit::getUniqueID(), and llvm::AsmPrinter::OutStreamer.
Referenced by constructInlinedScopeDIE().
|
inline |
getRanges - Get the list of ranges for this unit.
Definition at line 380 of file DwarfCompileUnit.h.
|
inline |
Definition at line 149 of file DwarfCompileUnit.h.
References llvm::Skeleton.
Referenced by llvm::DwarfDebug::endFunctionImpl().
bool DwarfCompileUnit::hasDwarfPubSections | ( | ) | const |
Definition at line 1501 of file DwarfCompileUnit.cpp.
References llvm::DICompileUnit::Apple, llvm::Apple, llvm::DwarfUnit::CUNode, llvm::DwarfUnit::DD, llvm::DICompileUnit::Default, llvm::DwarfDebug::getAccelTableKind(), llvm::DwarfDebug::getDwarfVersion(), llvm::DICompileUnit::getNameTableKind(), llvm::DICompileUnit::GNU, includeMinimalInlineScopes(), llvm::DICompileUnit::isDebugDirectivesOnly(), llvm_unreachable, llvm::DICompileUnit::None, and llvm::DwarfDebug::tuneForGDB().
Referenced by addGlobalName(), addGlobalNameForTypeUnit(), addGlobalTypeImpl(), and addGlobalTypeUnitType().
|
inline |
Definition at line 147 of file DwarfCompileUnit.h.
bool DwarfCompileUnit::includeMinimalInlineScopes | ( | ) | const |
Definition at line 1682 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::DD, llvm::DwarfUnit::getCUNode(), llvm::DICompileUnit::getEmissionKind(), llvm::DICompileUnit::LineTablesOnly, and llvm::DwarfDebug::useSplitDwarf().
Referenced by applySubprogramAttributesToDefinition(), constructAbstractSubprogramScopeDIE(), constructSubprogramScopeDIE(), createAndAddScopeChildren(), finishSubprogramDefinition(), hasDwarfPubSections(), and updateSubprogramScopeDIE().
void DwarfCompileUnit::initStmtList | ( | ) |
Definition at line 437 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::addSectionLabel(), llvm::DwarfUnit::Asm, llvm::DwarfUnit::CUNode, llvm::DwarfUnit::DD, llvm::MCSection::getBeginSymbol(), llvm::MCObjectFileInfo::getDwarfLineSection(), llvm::AsmPrinter::getObjFileLowering(), llvm::DwarfUnit::getUniqueID(), llvm::DIEUnit::getUnitDie(), llvm::DICompileUnit::isDebugDirectivesOnly(), llvm::AsmPrinter::OutStreamer, and llvm::DwarfDebug::useSectionsAsReferences().
Definition at line 383 of file DwarfCompileUnit.h.
References llvm::sampleprof::Base.
|
inline |
Definition at line 387 of file DwarfCompileUnit.h.
|
inline |
Set the skeleton unit associated with this unit.
Definition at line 307 of file DwarfCompileUnit.h.
References llvm::Skeleton.
|
inline |
Definition at line 381 of file DwarfCompileUnit.h.
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 514 of file DwarfCompileUnit.cpp.
References addAddress(), llvm::DwarfUnit::addBlock(), llvm::DwarfExpression::addExpression(), llvm::DwarfUnit::addFlag(), 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::DwarfDebug::getCurrentFunction(), llvm::TargetFrameLowering::getDwarfFrameBase(), llvm::TargetSubtargetInfo::getFrameLowering(), llvm::DICompileUnit::getNameTableKind(), llvm::DwarfUnit::getOrCreateSubprogramDIE(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), 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, llvm::TargetFrameLowering::DwarfFrameBase::Offset, llvm::TargetMachine::Options, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::TargetFrameLowering::DwarfFrameBase::Reg, llvm::TargetFrameLowering::DwarfFrameBase::Register, llvm::DwarfDebug::useAppleExtensionAttributes(), and llvm::TargetFrameLowering::DwarfFrameBase::WasmLoc.
Referenced by constructSubprogramScopeDIE().
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 1210 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnit::DD, llvm::DwarfDebug::getDwarfVersion(), and llvm::DwarfDebug::tuneForLLDB().
Referenced by constructCallSiteEntryDIE(), getDwarf5OrGNUAttr(), getDwarf5OrGNULocationAtom(), and getDwarf5OrGNUTag().
std::vector<BaseTypeRef> llvm::DwarfCompileUnit::ExprRefedBaseTypes |
Definition at line 177 of file DwarfCompileUnit.h.
Referenced by createBaseTypeDIEs().