Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Public Member Functions |Protected Member Functions |Protected Attributes |List of all members
llvm::DwarfUnit Class Referenceabstract

This dwarf writer support class manages information associated with a source file.More...

#include "CodeGen/AsmPrinter/DwarfUnit.h"

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

Public Member Functions

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
 
constDICompileUnitgetCUNode ()const
 
DwarfDebuggetDwarfDebug ()const
 
bool hasContent ()const
 Return true if this compile unit has something to write out.
 
std::string getParentContextString (constDIScope *Context)const
 Get string containing language specific context for a global name.
 
virtual void addGlobalName (StringRefName,constDIE &Die,constDIScope *Context)=0
 Add a new global name to the compile unit.
 
virtual void addGlobalTypeImpl (constDIType *Ty,constDIE &Die,constDIScope *Context)=0
 Add a new global type to the compile unit.
 
void addGlobalType (constDIType *Ty,constDIE &Die,constDIScope *Context)
 
DIEgetDIE (constDINode *D)const
 Returns theDIE map slot for the specified debug variable.
 
DIELocgetDIELoc ()
 Returns a fresh newly allocatedDIELoc.
 
void insertDIE (constDINode *Desc,DIE *D)
 InsertDIE into the map.
 
void insertDIE (DIE *D)
 
void addFlag (DIE &Die,dwarf::AttributeAttribute)
 Add a flag that is true to theDIE.
 
void addUInt (DIEValueList &Die,dwarf::AttributeAttribute, std::optional<dwarf::Form > Form,uint64_tInteger)
 Add an unsigned integer attribute data and value.
 
void addUInt (DIEValueList &Block,dwarf::Form Form,uint64_tInteger)
 
void addSInt (DIEValueList &Die,dwarf::AttributeAttribute, std::optional<dwarf::Form > Form, int64_tInteger)
 Add an signed integer attribute data and value.
 
void addSInt (DIELoc &Die, std::optional<dwarf::Form > Form, int64_tInteger)
 
void addString (DIE &Die,dwarf::AttributeAttribute,StringRef Str)
 Add a string attribute data and value.
 
void addLabel (DIEValueList &Die,dwarf::AttributeAttribute,dwarf::Form Form,constMCSymbol *Label)
 Add a Dwarf label attribute data and value.
 
void addLabel (DIELoc &Die,dwarf::Form Form,constMCSymbol *Label)
 
void addSectionOffset (DIE &Die,dwarf::AttributeAttribute,uint64_tInteger)
 Add an offset into a section attribute data and value.
 
void addOpAddress (DIELoc &Die,constMCSymbol *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,constMCSymbol *Label)
 
void addLabelDelta (DIEValueList &Die,dwarf::AttributeAttribute,constMCSymbol *Hi,constMCSymbol *Lo)
 Add a label delta attribute data and value.
 
void addDIEEntry (DIE &Die,dwarf::AttributeAttribute,DIE &Entry)
 Add aDIE attribute data and value.
 
void addDIEEntry (DIE &Die,dwarf::AttributeAttribute,DIEEntry Entry)
 Add aDIE 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::AttributeAttribute,DIELoc *Loc)
 Add block data.
 
void addBlock (DIE &Die,dwarf::AttributeAttribute,DIEBlock *Block)
 Add block data.
 
void addBlock (DIE &Die,dwarf::AttributeAttribute,dwarf::Form Form,DIEBlock *Block)
 
void addSourceLine (DIE &Die,unsigned Line,constDIFile *File)
 Add location information to specified debug information entry.
 
void addSourceLine (DIE &Die,constDILocalVariable *V)
 
void addSourceLine (DIE &Die,constDIGlobalVariable *G)
 
void addSourceLine (DIE &Die,constDISubprogram *SP)
 
void addSourceLine (DIE &Die,constDILabel *L)
 
void addSourceLine (DIE &Die,constDIType *Ty)
 
void addSourceLine (DIE &Die,constDIObjCProperty *Ty)
 
void addConstantValue (DIE &Die,constConstantInt *CI,constDIType *Ty)
 Add constant value entry in variableDIE.
 
void addConstantValue (DIE &Die,constAPInt &Val,constDIType *Ty)
 
void addConstantValue (DIE &Die,constAPInt &Val,boolUnsigned)
 
void addConstantValue (DIE &Die,uint64_t Val,constDIType *Ty)
 
void addConstantValue (DIE &Die,boolUnsigned,uint64_t Val)
 
void addConstantFPValue (DIE &Die,constConstantFP *CFP)
 Add constant value entry in variableDIE.
 
void addLinkageName (DIE &Die,StringRefLinkageName)
 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,constDIType *Ty,dwarf::AttributeAttribute=dwarf::DW_AT_type)
 Add a new type attribute to the specified entity.
 
DIEgetOrCreateNameSpace (constDINamespace *NS)
 
DIEgetOrCreateModule (constDIModule *M)
 
DIEgetOrCreateSubprogramDIE (constDISubprogram *SP,bool Minimal=false)
 
void applySubprogramAttributes (constDISubprogram *SP,DIE &SPDie,bool SkipSPAttributes=false)
 
DIEcreateTypeDIE (constDIScope *Context,DIE &ContextDIE,constDIType *Ty)
 Creates typeDIE with specific context.
 
virtualDIEgetOrCreateTypeDIE (constMDNode *TyNode)
 Find existingDIE or create newDIE for the given type.
 
virtualDIEgetOrCreateContextDIE (constDIScope *Context)
 Get context owner'sDIE.
 
void constructContainingTypeDIEs ()
 Construct DIEs for types that contain vtables.
 
DIEconstructSubprogramArguments (DIE &Buffer,DITypeRefArray Args)
 Construct function argument DIEs.
 
DIEcreateAndAddDIE (dwarf::TagTag,DIE &Parent,constDINode *N=nullptr)
 Create aDIE with the given Tag, add theDIE to its parent, and call insertDIE if MD is not null.
 
bool useSegmentedStringOffsetsTable ()const
 
virtualunsigned 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 unitDIE.
 
void addRnglistsBase ()
 Add the DW_AT_rnglists_base attribute to the unitDIE.
 
virtualDwarfCompileUnitgetCU ()=0
 
void constructTypeDIE (DIE &Buffer,constDICompositeType *CTy)
 
void addSectionDelta (DIE &Die,dwarf::AttributeAttribute,constMCSymbol *Hi,constMCSymbol *Lo)
 addSectionDelta - Add a label delta attribute data and value.
 
void addSectionLabel (DIE &Die,dwarf::AttributeAttribute,constMCSymbol *Label,constMCSymbol *Sec)
 Add a Dwarf section label attribute data and value.
 
void addAnnotation (DIE &Buffer, DINodeArrayAnnotations)
 Add DW_TAG_LLVM_annotation.
 
DIEcreateTypeDIE (constDICompositeType *Ty)
 Get context owner'sDIE.
 
void updateAcceleratorTables (constDIScope *Context,constDIType *Ty,constDIE &TyDIE)
 If this is a named finished type then include it in the list of types for the accelerator tables.
 
- Public Member Functions inherited fromllvm::DIEUnit
 DIEUnit (dwarf::Tag UnitTag)
 
 DIEUnit (constDIEUnit &RHS)=delete
 
 DIEUnit (DIEUnit &&RHS)=delete
 
void operator= (constDIEUnit &RHS)=delete
 
void operator= (constDIEUnit &&RHS)=delete
 
void setSection (MCSection *Section)
 Set the section that thisDIEUnit will be emitted into.
 
virtualconstMCSymbolgetCrossSectionRelativeBaseAddress ()const
 
MCSectiongetSection ()const
 Return the section that thisDIEUnit will be emitted into.
 
void setDebugSectionOffset (uint64_t O)
 
uint64_t getDebugSectionOffset ()const
 
DIEgetUnitDie ()
 
constDIEgetUnitDie ()const
 

Protected Member Functions

 DwarfUnit (dwarf::Tag,constDICompileUnit *Node,AsmPrinter *A,DwarfDebug *DW,DwarfFile *DWU,unsignedUniqueID=0)
 
bool applySubprogramDefinitionAttributes (constDISubprogram *SP,DIE &SPDie,bool Minimal)
 
bool isShareableAcrossCUs (constDINode *D)const
 Check whether theDIE for thisMDNode can be shared across CUs.
 
template<typenameT >
void addAttribute (DIEValueList &Die,dwarf::AttributeAttribute,dwarf::Form Form,T &&Value)
 
 ~DwarfUnit ()
 
DIEgetOrCreateStaticMemberDIE (constDIDerivedType *DT)
 Create new static data memberDIE.
 
virtualunsigned getOrCreateSourceID (constDIFile *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 fromllvm::DIEUnit
virtual ~DIEUnit ()=default
 .debug_info or .debug_types absolute section offset.
 

Protected Attributes

unsigned UniqueID
 A numeric ID unique among all CUs in the module.
 
constDICompileUnitCUNode
 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 theCU and used to compute theCU Length field.
 
DwarfDebugDD
 
DwarfFileDU
 
DIEIndexTyDie = nullptr
 An anonymous type for index type. Owned byDIEUnit.
 
DenseMap<constMDNode *,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 *,constDINode * > ContainingTypeMap
 This map is used to keep track of subprogram DIEs that need DW_AT_containing_type attribute.
 

Detailed Description

This dwarf writer support class manages information associated with a source file.

Definition at line35 of fileDwarfUnit.h.

Constructor & Destructor Documentation

◆ DwarfUnit()

DwarfUnit::DwarfUnit(dwarf::Tag UnitTag,
constDICompileUnitNode,
AsmPrinterA,
DwarfDebugDW,
DwarfFileDWU,
unsigned UniqueID =0 
)
protected

Definition at line83 of fileDwarfUnit.cpp.

◆ ~DwarfUnit()

DwarfUnit::~DwarfUnit()
protected

Definition at line95 of fileDwarfUnit.cpp.

ReferencesB,DIEBlocks, andDIELocs.

Member Function Documentation

◆ addAccess()

void DwarfUnit::addAccess(DIEDie,
DINode::DIFlags Flags 
)

Add the accessibility attribute.

Definition at line534 of fileDwarfUnit.cpp.

ReferencesaddUInt(),llvm::dwarf::DW_ACCESS_private,llvm::dwarf::DW_ACCESS_protected,llvm::dwarf::DW_ACCESS_public, andllvm::DINode::FlagAccessibility.

Referenced byapplySubprogramAttributes(),constructTypeDIE(), andgetOrCreateStaticMemberDIE().

◆ addAnnotation()

void DwarfUnit::addAnnotation(DIEBuffer,
DINodeArray Annotations 
)

Add DW_TAG_LLVM_annotation.

Definition at line905 of fileDwarfUnit.cpp.

ReferencesaddConstantValue(),addString(),assert(),createAndAddDIE(),llvm::Data,llvm::MDNode::getOperand(), andName.

Referenced byllvm::DwarfCompileUnit::applyCommonDbgVariableAttributes(),applySubprogramAttributes(),constructTypeDIE(), andllvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE().

◆ addAttribute()

template<typenameT >
void llvm::DwarfUnit::addAttribute(DIEValueListDie,
dwarf::Attribute Attribute,
dwarf::Form Form,
T && Value 
)
inlineprotected

Definition at line84 of fileDwarfUnit.h.

Referencesllvm::DIEValueList::addValue(),Asm,llvm::dwarf::AttributeVersion(),DD,llvm::TargetOptions::DebugStrictDwarf,DIEValueAllocator,llvm::DwarfDebug::getDwarfVersion(),llvm::TargetMachine::Options, andllvm::AsmPrinter::TM.

Referenced byllvm::DwarfCompileUnit::addBaseTypeRef(),addBlock(),addDIEEntry(),addDIETypeSignature(),llvm::DwarfCompileUnit::addExpr(),addFlag(),addLabel(),llvm::DwarfCompileUnit::addLabelAddress(),addLabelDelta(),llvm::DwarfCompileUnit::addLocalLabelAddress(),llvm::DwarfCompileUnit::addLocationList(),addSectionDelta(),addSInt(),addString(), andaddUInt().

◆ addBlock()[1/3]

void DwarfUnit::addBlock(DIEDie,
dwarf::Attribute Attribute,
DIEBlockBlock 
)

Add block data.

Definition at line404 of fileDwarfUnit.cpp.

ReferencesaddBlock(), andllvm::Block.

◆ addBlock()[2/3]

void DwarfUnit::addBlock(DIEDie,
dwarf::Attribute Attribute,
DIELocLoc 
)

Add block data.

Definition at line391 of fileDwarfUnit.cpp.

ReferencesaddAttribute(),Asm,llvm::DIELoc::BestForm(),llvm::DIELoc::computeSize(),DD,DIELocs,llvm::AsmPrinter::getDwarfFormParams(), andllvm::DwarfDebug::getDwarfVersion().

Referenced byllvm::DwarfCompileUnit::addAddress(),addBlock(),llvm::DwarfCompileUnit::addComplexAddress(),addConstantValue(),llvm::DwarfCompileUnit::addLabelAddress(),llvm::DwarfCompileUnit::addLocationAttribute(),applySubprogramAttributes(),llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs(), andllvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ addBlock()[3/3]

void DwarfUnit::addBlock(DIEDie,
dwarf::Attribute Attribute,
dwarf::Form Form,
DIEBlockBlock 
)

Definition at line397 of fileDwarfUnit.cpp.

ReferencesaddAttribute(),Asm,llvm::Block,DIEBlocks, andllvm::AsmPrinter::getDwarfFormParams().

◆ addConstantFPValue()

void DwarfUnit::addConstantFPValue(DIEDie,
constConstantFPCFP 
)

Add constant value entry in variableDIE.

Definition at line454 of fileDwarfUnit.cpp.

ReferencesaddConstantValue(),llvm::APFloat::bitcastToAPInt(), andllvm::ConstantFP::getValueAPF().

Referenced bygetOrCreateStaticMemberDIE().

◆ addConstantValue()[1/5]

void DwarfUnit::addConstantValue(DIEDie,
bool Unsigned,
uint64_t Val 
)

Definition at line468 of fileDwarfUnit.cpp.

ReferencesaddUInt(), andUnsigned.

◆ addConstantValue()[2/5]

void DwarfUnit::addConstantValue(DIEDie,
constAPIntVal,
bool Unsigned 
)

Definition at line479 of fileDwarfUnit.cpp.

ReferencesaddBlock(),addConstantValue(),addUInt(),Asm,llvm::Block,DIEValueAllocator,llvm::APInt::getBitWidth(),llvm::AsmPrinter::getDataLayout(),llvm::APInt::getRawData(),llvm::APInt::getSExtValue(),llvm::APInt::getZExtValue(),llvm::DataLayout::isLittleEndian(), andUnsigned.

◆ addConstantValue()[3/5]

void DwarfUnit::addConstantValue(DIEDie,
constAPIntVal,
constDITypeTy 
)

Definition at line475 of fileDwarfUnit.cpp.

ReferencesaddConstantValue(),DD, andllvm::DebugHandlerBase::isUnsignedDIType().

◆ addConstantValue()[4/5]

void DwarfUnit::addConstantValue(DIEDie,
constConstantIntCI,
constDITypeTy 
)

Add constant value entry in variableDIE.

Definition at line459 of fileDwarfUnit.cpp.

ReferencesaddConstantValue(), andllvm::ConstantInt::getValue().

Referenced byaddAnnotation(),addConstantFPValue(),addConstantValue(),llvm::DwarfCompileUnit::addLocationAttribute(), andgetOrCreateStaticMemberDIE().

◆ addConstantValue()[5/5]

void DwarfUnit::addConstantValue(DIEDie,
uint64_t Val,
constDITypeTy 
)

Definition at line464 of fileDwarfUnit.cpp.

ReferencesaddConstantValue(),DD, andllvm::DebugHandlerBase::isUnsignedDIType().

◆ addDIEEntry()[1/2]

void DwarfUnit::addDIEEntry(DIEDie,
dwarf::Attribute Attribute,
DIEEntry 
)

Add aDIE attribute data and value.

Definition at line353 of fileDwarfUnit.cpp.

ReferencesaddDIEEntry().

Referenced byaddDIEEntry(),addType(),applySubprogramAttributes(),applySubprogramDefinitionAttributes(),llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE(),llvm::DwarfCompileUnit::constructCallSiteEntryDIE(),constructContainingTypeDIEs(),llvm::DwarfCompileUnit::constructImportedEntityDIE(),llvm::DwarfCompileUnit::constructInlinedScopeDIE(),llvm::DwarfCompileUnit::constructSubprogramScopeDIE(),constructTypeDIE(),llvm::DwarfCompileUnit::finishEntityDefinition(),llvm::DwarfCompileUnit::finishSubprogramDefinition(), andllvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE().

◆ addDIEEntry()[2/2]

void DwarfUnit::addDIEEntry(DIEDie,
dwarf::Attribute Attribute,
DIEEntry Entry 
)

Add aDIE attribute data and value.

Definition at line368 of fileDwarfUnit.cpp.

ReferencesaddAttribute(),assert(),DD,llvm::DIE::getUnit(),llvm::DIEUnit::getUnitDie(),llvm::DwarfDebug::shareAcrossDWOCUs(), andllvm::DwarfDebug::useSplitDwarf().

◆ addDIETypeSignature()

void DwarfUnit::addDIETypeSignature(DIEDie,
uint64_t Signature 
)

Add a type's DW_AT_signature and set the declaration flag.

Definition at line357 of fileDwarfUnit.cpp.

ReferencesaddAttribute(), andaddFlag().

◆ addFlag()

void DwarfUnit::addFlag(DIEDie,
dwarf::Attribute Attribute 
)

Add a flag that is true to theDIE.

Definition at line214 of fileDwarfUnit.cpp.

ReferencesaddAttribute(),DD, andllvm::DwarfDebug::getDwarfVersion().

Referenced byaddDIETypeSignature(),llvm::DwarfCompileUnit::applyCommonDbgVariableAttributes(),applySubprogramAttributes(),llvm::DwarfCompileUnit::constructCallSiteEntryDIE(),constructSubprogramArguments(),constructTypeDIE(),llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(),getOrCreateModule(),getOrCreateNameSpace(),getOrCreateStaticMemberDIE(), andllvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ addGlobalName()

virtual void llvm::DwarfUnit::addGlobalName(StringRef Name,
constDIEDie,
constDIScopeContext 
)
pure virtual

Add a new global name to the compile unit.

Implemented inllvm::DwarfCompileUnit, andllvm::DwarfTypeUnit.

Referenced bygetOrCreateModule(), andgetOrCreateNameSpace().

◆ addGlobalType()

void DwarfUnit::addGlobalType(constDITypeTy,
constDIEDie,
constDIScopeContext 
)

Definition at line668 of fileDwarfUnit.cpp.

ReferencesaddGlobalTypeImpl().

Referenced bycreateTypeDIE(), andupdateAcceleratorTables().

◆ addGlobalTypeImpl()

virtual void llvm::DwarfUnit::addGlobalTypeImpl(constDITypeTy,
constDIEDie,
constDIScopeContext 
)
pure virtual

Add a new global type to the compile unit.

Implemented inllvm::DwarfCompileUnit, andllvm::DwarfTypeUnit.

Referenced byaddGlobalType().

◆ addLabel()[1/2]

void DwarfUnit::addLabel(DIELocDie,
dwarf::Form Form,
constMCSymbolLabel 
)

Definition at line285 of fileDwarfUnit.cpp.

ReferencesaddLabel().

◆ addLabel()[2/2]

void DwarfUnit::addLabel(DIEValueListDie,
dwarf::Attribute Attribute,
dwarf::Form Form,
constMCSymbolLabel 
)

Add a Dwarf label attribute data and value.

Definition at line280 of fileDwarfUnit.cpp.

ReferencesaddAttribute().

Referenced byaddLabel(),addOpAddress(), andaddSectionLabel().

◆ addLabelDelta()

void DwarfUnit::addLabelDelta(DIEValueListDie,
dwarf::Attribute Attribute,
constMCSymbolHi,
constMCSymbolLo 
)

Add a label delta attribute data and value.

Definition at line347 of fileDwarfUnit.cpp.

ReferencesaddAttribute(),DIEValueAllocator,llvm::Hi, andllvm::Lo.

Referenced byaddPoolOpAddress(), andllvm::DwarfCompileUnit::attachLowHighPC().

◆ addLinkageName()

void DwarfUnit::addLinkageName(DIEDie,
StringRef LinkageName 
)

Add a linkage name, if it isn't empty.

Definition at line508 of fileDwarfUnit.cpp.

ReferencesaddString(),DD,llvm::GlobalValue::dropLLVMManglingEscape(),llvm::DwarfDebug::getDwarfVersion(), andllvm::LinkageName.

Referenced byllvm::DwarfCompileUnit::addLocationAttribute(),applySubprogramDefinitionAttributes(), andllvm::DwarfCompileUnit::constructCallSiteEntryDIE().

◆ addOpAddress()

void DwarfUnit::addOpAddress(DIELocDie,
constMCSymbolSym 
)

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.

Definition at line332 of fileDwarfUnit.cpp.

ReferencesaddLabel(),addPoolOpAddress(),addUInt(),DD,llvm::DwarfDebug::getDwarfVersion(),Sym, andllvm::DwarfDebug::useSplitDwarf().

Referenced byllvm::DwarfCompileUnit::addLocationAttribute().

◆ addPoolOpAddress()

void DwarfUnit::addPoolOpAddress(DIEValueListDie,
constMCSymbolLabel 
)

Definition at line307 of fileDwarfUnit.cpp.

ReferencesaddLabelDelta(),addUInt(),llvm::sampleprof::Base,DD,llvm::DwarfDebug::getAddressPool(),llvm::DwarfDebug::getDwarfVersion(),llvm::AddressPool::getIndex(),llvm::DwarfDebug::getSectionLabel(),llvm::DwarfDebug::useAddrOffsetExpressions(), andllvm::DwarfDebug::useAddrOffsetForm().

Referenced byllvm::DwarfCompileUnit::addLabelAddress(), andaddOpAddress().

◆ addRnglistsBase()

void DwarfUnit::addRnglistsBase()

Add the DW_AT_rnglists_base attribute to the unitDIE.

Definition at line1919 of fileDwarfUnit.cpp.

ReferencesaddSectionLabel(),Asm,assert(),DD,DU,llvm::MCSection::getBeginSymbol(),llvm::MCObjectFileInfo::getDwarfRnglistsSection(),llvm::DwarfDebug::getDwarfVersion(),llvm::AsmPrinter::getObjFileLowering(),llvm::DwarfFile::getRnglistsTableBaseSym(), andllvm::DIEUnit::getUnitDie().

◆ addSectionDelta()

void DwarfUnit::addSectionDelta(DIEDie,
dwarf::Attribute Attribute,
constMCSymbolHi,
constMCSymbolLo 
)

addSectionDelta - Add a label delta attribute data and value.

Definition at line1874 of fileDwarfUnit.cpp.

ReferencesaddAttribute(),DD,DIEValueAllocator,llvm::DwarfDebug::getDwarfSectionOffsetForm(),llvm::Hi, andllvm::Lo.

Referenced byllvm::DwarfCompileUnit::addScopeRangeList(), andaddSectionLabel().

◆ addSectionLabel()

void DwarfUnit::addSectionLabel(DIEDie,
dwarf::Attribute Attribute,
constMCSymbolLabel,
constMCSymbolSec 
)

Add a Dwarf section label attribute data and value.

Definition at line1880 of fileDwarfUnit.cpp.

ReferencesaddLabel(),addSectionDelta(),Asm,DD,llvm::AsmPrinter::doesDwarfUseRelocationsAcrossSections(), andllvm::DwarfDebug::getDwarfSectionOffsetForm().

Referenced byllvm::DwarfCompileUnit::addAddrTableBase(),addRnglistsBase(),llvm::DwarfCompileUnit::addScopeRangeList(),addStringOffsetsStart(),llvm::DwarfCompileUnit::applyStmtList(),llvm::DwarfCompileUnit::initStmtList(), andllvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ addSectionOffset()

void DwarfUnit::addSectionOffset(DIEDie,
dwarf::Attribute Attribute,
uint64_t Integer 
)

Add an offset into a section attribute data and value.

Definition at line289 of fileDwarfUnit.cpp.

ReferencesaddUInt(),DD,llvm::DwarfDebug::getDwarfSectionOffsetForm(), andllvm::Integer.

◆ addSInt()[1/2]

void DwarfUnit::addSInt(DIELocDie,
std::optional<dwarf::FormForm,
int64_t Integer 
)

Definition at line242 of fileDwarfUnit.cpp.

ReferencesaddSInt(), andllvm::Integer.

◆ addSInt()[2/2]

void DwarfUnit::addSInt(DIEValueListDie,
dwarf::Attribute Attribute,
std::optional<dwarf::FormForm,
int64_t Integer 
)

Add an signed integer attribute data and value.

Definition at line235 of fileDwarfUnit.cpp.

ReferencesaddAttribute(),llvm::DIEInteger::BestForm(), andllvm::Integer.

Referenced byllvm::DwarfCompileUnit::addLocationAttribute(),addSInt(),llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE(),constructTypeDIE(), andllvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ addSourceLine()[1/7]

void DwarfUnit::addSourceLine(DIEDie,
constDIGlobalVariableG 
)

Definition at line424 of fileDwarfUnit.cpp.

ReferencesaddSourceLine(),assert(), andG.

◆ addSourceLine()[2/7]

void DwarfUnit::addSourceLine(DIEDie,
constDILabelL 
)

Definition at line436 of fileDwarfUnit.cpp.

ReferencesaddSourceLine(), andassert().

◆ addSourceLine()[3/7]

void DwarfUnit::addSourceLine(DIEDie,
constDILocalVariableV 
)

Definition at line418 of fileDwarfUnit.cpp.

ReferencesaddSourceLine(), andassert().

◆ addSourceLine()[4/7]

void DwarfUnit::addSourceLine(DIEDie,
constDIObjCPropertyTy 
)

Definition at line448 of fileDwarfUnit.cpp.

ReferencesaddSourceLine(),assert(),llvm::DIObjCProperty::getFile(), andllvm::DIObjCProperty::getLine().

◆ addSourceLine()[5/7]

void DwarfUnit::addSourceLine(DIEDie,
constDISubprogramSP 
)

Definition at line430 of fileDwarfUnit.cpp.

ReferencesaddSourceLine(),assert(), andllvm::DIScope::getFile().

◆ addSourceLine()[6/7]

void DwarfUnit::addSourceLine(DIEDie,
constDITypeTy 
)

Definition at line442 of fileDwarfUnit.cpp.

ReferencesaddSourceLine(),assert(),llvm::DIScope::getFile(), andllvm::DIType::getLine().

◆ addSourceLine()[7/7]

void DwarfUnit::addSourceLine(DIEDie,
unsigned Line,
constDIFileFile 
)

Add location information to specified debug information entry.

Definition at line409 of fileDwarfUnit.cpp.

ReferencesaddUInt(), andgetOrCreateSourceID().

Referenced byaddSourceLine(),llvm::DwarfCompileUnit::applyCommonDbgVariableAttributes(),llvm::DwarfCompileUnit::applyLabelAttributes(),applySubprogramAttributes(),llvm::DwarfCompileUnit::constructImportedEntityDIE(),constructTypeDIE(),llvm::DwarfCompileUnit::getOrCreateCommonBlock(),llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(), andgetOrCreateStaticMemberDIE().

◆ addString()

void DwarfUnit::addString(DIEDie,
dwarf::Attribute Attribute,
StringRef Str 
)

Add a string attribute data and value.

We always emit a reference to the string pool instead of immediate strings so that DIEs have more predictable sizes. In the case of split dwarf we emit an index into another table which gets us the static offset into the string table.

Definition at line247 of fileDwarfUnit.cpp.

ReferencesaddAttribute(),Asm,CUNode,DD,DIEValueAllocator,DU,llvm::DwarfStringPool::getEntry(),llvm::DwarfStringPool::getIndexedEntry(),llvm::DwarfFile::getStringPool(),llvm::DICompileUnit::isDebugDirectivesOnly(),llvm::String,llvm::DwarfDebug::useInlineStrings(), anduseSegmentedStringOffsetsTable().

Referenced byaddAnnotation(),llvm::DwarfDebug::addDwarfTypeUnitType(),addLinkageName(),llvm::DwarfCompileUnit::applyCommonDbgVariableAttributes(),llvm::DwarfCompileUnit::applyLabelAttributes(),applySubprogramAttributes(),llvm::DwarfCompileUnit::constructImportedEntityDIE(),constructTypeDIE(),llvm::DwarfCompileUnit::createBaseTypeDIEs(),llvm::DwarfCompileUnit::getOrCreateCommonBlock(),llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(),getOrCreateModule(),getOrCreateNameSpace(), andgetOrCreateStaticMemberDIE().

◆ addStringOffsetsStart()

void DwarfUnit::addStringOffsetsStart()

Add the DW_AT_str_offsets_base attribute to the unitDIE.

Definition at line1912 of fileDwarfUnit.cpp.

ReferencesaddSectionLabel(),Asm,DU,llvm::MCSection::getBeginSymbol(),llvm::MCObjectFileInfo::getDwarfStrOffSection(),llvm::AsmPrinter::getObjFileLowering(),llvm::DwarfFile::getStringOffsetsStartSym(), andllvm::DIEUnit::getUnitDie().

Referenced byllvm::DwarfDebug::addDwarfTypeUnitType().

◆ addTemplateParams()

void DwarfUnit::addTemplateParams(DIEBuffer,
DINodeArray TParams 
)

Add template parameters in buffer.

Definition at line516 of fileDwarfUnit.cpp.

Referenced byapplySubprogramDefinitionAttributes(),constructTypeDIE(), andllvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE().

◆ addThrownTypes()

void DwarfUnit::addThrownTypes(DIEDie,
DINodeArray ThrownTypes 
)

Add thrown types.

Definition at line527 of fileDwarfUnit.cpp.

ReferencesaddType(), andcreateAndAddDIE().

Referenced byapplySubprogramAttributes().

◆ addType()

void DwarfUnit::addType(DIEEntity,
constDITypeTy,
dwarf::Attribute Attribute =dwarf::DW_AT_type 
)

Add a new type attribute to the specified entity.

This takes and attribute parameter because DW_AT_friend attributes are also type references.

Definition at line675 of fileDwarfUnit.cpp.

ReferencesaddDIEEntry(),assert(), andgetOrCreateTypeDIE().

Referenced byaddThrownTypes(),llvm::DwarfCompileUnit::applyCommonDbgVariableAttributes(),applySubprogramAttributes(),applySubprogramDefinitionAttributes(),constructSubprogramArguments(),constructTypeDIE(),llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(), andgetOrCreateStaticMemberDIE().

◆ addUInt()[1/2]

void DwarfUnit::addUInt(DIEValueListBlock,
dwarf::Form Form,
uint64_t Integer 
)

Definition at line230 of fileDwarfUnit.cpp.

ReferencesaddUInt(),llvm::Block, andllvm::Integer.

◆ addUInt()[2/2]

void DwarfUnit::addUInt(DIEValueListDie,
dwarf::Attribute Attribute,
std::optional<dwarf::FormForm,
uint64_t Integer 
)

Add an unsigned integer attribute data and value.

Definition at line221 of fileDwarfUnit.cpp.

ReferencesaddAttribute(),assert(),llvm::DIEInteger::BestForm(), andllvm::Integer.

Referenced byaddAccess(),llvm::DwarfCompileUnit::addAddress(),llvm::DwarfCompileUnit::addComplexAddress(),addConstantValue(),llvm::DwarfDebug::addDwarfTypeUnitType(),llvm::DwarfCompileUnit::addLocationAttribute(),addOpAddress(),addPoolOpAddress(),llvm::DwarfCompileUnit::addScopeRangeList(),addSectionOffset(),addSourceLine(),addUInt(),llvm::DwarfCompileUnit::applyCommonDbgVariableAttributes(),applySubprogramAttributes(),applySubprogramDefinitionAttributes(),llvm::DwarfCompileUnit::constructInlinedScopeDIE(),constructTypeDIE(),llvm::DwarfCompileUnit::createBaseTypeDIEs(),llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(),getOrCreateModule(),getOrCreateStaticMemberDIE(), andllvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ applySubprogramAttributes()

void DwarfUnit::applySubprogramAttributes(constDISubprogramSP,
DIESPDie,
bool SkipSPAttributes =false 
)

Definition at line1304 of fileDwarfUnit.cpp.

ReferencesaddAccess(),addAnnotation(),addBlock(),addDIEEntry(),addFlag(),addSourceLine(),addString(),addThrownTypes(),addType(),addUInt(),applySubprogramDefinitionAttributes(),Asm,llvm::Block,CC,constructSubprogramArguments(),ContainingTypeMap,CUNode,DD,llvm::StringRef::empty(),llvm::DICompileUnit::getDebugInfoForProfiling(),getDIELoc(),llvm::DwarfDebug::getDwarfVersion(),llvm::AsmPrinter::getISAEncoding(),getLanguage(),llvm::DIScope::getName(),llvm::isa(),llvm::dwarf::isC(), andllvm::DwarfDebug::useAppleExtensionAttributes().

Referenced byllvm::DwarfCompileUnit::applySubprogramAttributesToDefinition(), andgetOrCreateSubprogramDIE().

◆ applySubprogramDefinitionAttributes()

bool DwarfUnit::applySubprogramDefinitionAttributes(constDISubprogramSP,
DIESPDie,
bool Minimal 
)
protected

Definition at line1251 of fileDwarfUnit.cpp.

ReferencesaddDIEEntry(),addLinkageName(),addTemplateParams(),addType(),addUInt(),assert(),DD,DU,llvm::StringRef::empty(),llvm::DwarfFile::getAbstractScopeDIEs(),getDIE(),llvm::DIScope::getFile(),getOrCreateSourceID(),llvm::LinkageName,llvm::DITypeRefArray::size(), andllvm::DwarfDebug::useAllLinkageNames().

Referenced byapplySubprogramAttributes().

◆ constructContainingTypeDIEs()

void DwarfUnit::constructContainingTypeDIEs()

Construct DIEs for types that contain vtables.

Definition at line1646 of fileDwarfUnit.cpp.

ReferencesaddDIEEntry(),ContainingTypeMap,D,getDIE(), andP.

◆ constructSubprogramArguments()

DIE * DwarfUnit::constructSubprogramArguments(DIEBuffer,
DITypeRefArray Args 
)

Construct function argument DIEs.

Returns
DIE of the object pointer if one exists. Nullptr otherwise.

Definition at line852 of fileDwarfUnit.cpp.

ReferencesaddFlag(),addType(),assert(),createAndAddDIE(),llvm::DIType::isArtificial(),llvm::DIType::isObjectPointer(), andN.

Referenced byapplySubprogramAttributes().

◆ constructTypeDIE()

void DwarfUnit::constructTypeDIE(DIEBuffer,
constDICompositeTypeCTy 
)

Definition at line926 of fileDwarfUnit.cpp.

ReferencesaddAccess(),addAnnotation(),addDIEEntry(),addFlag(),addSInt(),addSourceLine(),addString(),addTemplateParams(),addType(),addUInt(),Asm,CC,constructTypeDIE(),createAndAddDIE(),DD,llvm::TargetOptions::DebugStrictDwarf,llvm::StringRef::empty(),llvm::DIType::getAlignInBytes(),llvm::DICompositeType::getAnnotations(),getDIE(),llvm::DICompositeType::getDiscriminator(),llvm::DwarfDebug::getDwarfVersion(),llvm::DICompositeType::getElements(),llvm::DIType::getExportSymbols(),llvm::DIType::getFlags(),llvm::DICompositeType::getIdentifier(),llvm::DIType::getName(),llvm::DIType::getNumExtraInhabitants(),getOrCreateContextDIE(),getOrCreateStaticMemberDIE(),getOrCreateSubprogramDIE(),getOrCreateTypeDIE(),llvm::DICompositeType::getRawIdentifier(),llvm::DICompositeType::getRuntimeLang(),llvm::DIType::getSizeInBits(),llvm::DICompositeType::getSpecification(),llvm::DIE::getTag(),llvm::DICompositeType::getTemplateParams(),llvm::DICompositeType::getVTableHolder(),llvm::DIType::isAppleBlockExtension(),llvm::DIType::isForwardDecl(),llvm::DIType::isObjcClassComplete(),llvm::DIType::isTypePassByReference(),llvm::DIType::isTypePassByValue(),llvm::DebugHandlerBase::isUnsignedDIType(),Name,llvm::TargetMachine::Options,Size,llvm::Tag, andllvm::AsmPrinter::TM.

Referenced byconstructTypeDIE(), andcreateTypeDIE().

◆ createAndAddDIE()

DIE & DwarfUnit::createAndAddDIE(dwarf::Tag Tag,
DIEParent,
constDINodeN =nullptr 
)

Create aDIE with the given Tag, add theDIE to its parent, and call insertDIE if MD is not null.

Definition at line384 of fileDwarfUnit.cpp.

Referencesllvm::DIE::addChild(),DIEValueAllocator,llvm::DIE::get(),insertDIE(),N, andllvm::Tag.

Referenced byaddAnnotation(),addThrownTypes(),llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE(),llvm::DwarfCompileUnit::constructCallSiteEntryDIE(),constructSubprogramArguments(),constructTypeDIE(),createTypeDIE(),llvm::DwarfCompileUnit::getOrCreateCommonBlock(),llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(),getOrCreateModule(),getOrCreateNameSpace(),getOrCreateStaticMemberDIE(), andgetOrCreateSubprogramDIE().

◆ createTypeDIE()[1/2]

DIE * DwarfUnit::createTypeDIE(constDICompositeTypeTy)

Get context owner'sDIE.

Definition at line560 of fileDwarfUnit.cpp.

ReferencesconstructTypeDIE(),createAndAddDIE(),getDIE(),getOrCreateContextDIE(),llvm::DIType::getScope(),llvm::DINode::getTag(), andupdateAcceleratorTables().

◆ createTypeDIE()[2/2]

DIE * DwarfUnit::createTypeDIE(constDIScopeContext,
DIEContextDIE,
constDITypeTy 
)

Creates typeDIE with specific context.

Definition at line576 of fileDwarfUnit.cpp.

Referencesllvm::DwarfDebug::addDwarfTypeUnitType(),addGlobalType(),constructTypeDIE(),createAndAddDIE(),DD,llvm::DwarfDebug::generateTypeUnits(),getCU(),llvm::DIType::getRawName(),llvm::DINode::getTag(),llvm::DIType::isForwardDecl(), andupdateAcceleratorTables().

Referenced byllvm::DwarfDebug::addDwarfTypeUnitType(), andgetOrCreateTypeDIE().

◆ emitCommonHeader()

void DwarfUnit::emitCommonHeader(bool UseOffsets,
dwarf::UnitType UT 
)
protected

Emit the common part of the header for this unit.

Definition at line1821 of fileDwarfUnit.cpp.

ReferencesAsm,DD,llvm::AsmPrinter::emitDwarfLengthOrOffset(),llvm::AsmPrinter::emitDwarfSymbolReference(),llvm::AsmPrinter::emitDwarfUnitLength(),llvm::AsmPrinter::emitInt16(),llvm::AsmPrinter::emitInt8(),EndLabel,llvm::MCSection::getBeginSymbol(),llvm::MCAsmInfo::getCodePointerSize(),llvm::MCObjectFileInfo::getDwarfAbbrevSection(),llvm::DwarfDebug::getDwarfVersion(),getHeaderSize(),llvm::AsmPrinter::getObjFileLowering(),getSize(),llvm::DIEUnit::getUnitDie(),llvm::AsmPrinter::MAI,llvm::AsmPrinter::OutStreamer,llvm::DwarfDebug::useSectionsAsReferences(), andllvm::Version.

Referenced byllvm::DwarfCompileUnit::emitHeader(), andllvm::DwarfTypeUnit::emitHeader().

◆ emitHeader()

virtual void llvm::DwarfUnit::emitHeader(bool UseOffsets)
pure virtual

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

Implemented inllvm::DwarfCompileUnit, andllvm::DwarfTypeUnit.

Referenced byllvm::DwarfFile::emitUnit().

◆ getAsmPrinter()

AsmPrinter * llvm::DwarfUnit::getAsmPrinter() const
inline

Definition at line103 of fileDwarfUnit.h.

ReferencesAsm.

◆ getCU()

virtualDwarfCompileUnit & llvm::DwarfUnit::getCU()
pure virtual

Implemented inllvm::DwarfCompileUnit, andllvm::DwarfTypeUnit.

Referenced bycreateTypeDIE().

◆ getCUNode()

constDICompileUnit * llvm::DwarfUnit::getCUNode() const
inline

Definition at line111 of fileDwarfUnit.h.

ReferencesCUNode.

Referenced byllvm::DwarfFile::emitUnit(),llvm::DwarfDebug::endFunctionImpl(), andllvm::DwarfCompileUnit::includeMinimalInlineScopes().

◆ getDIE()

DIE * DwarfUnit::getDIE(constDINodeD) const

Returns theDIE map slot for the specified debug variable.

We delegate the request toDwarfDebug when theMDNode can be part of the type system, since DIEs for the type system can be shared across CUs and the mappings are kept inDwarfDebug.

Definition at line196 of fileDwarfUnit.cpp.

ReferencesD,DU,llvm::DwarfFile::getDIE(),isShareableAcrossCUs(), andMDNodeToDieMap.

Referenced byapplySubprogramDefinitionAttributes(),constructContainingTypeDIEs(),llvm::DwarfCompileUnit::constructImportedEntityDIE(),constructTypeDIE(),createTypeDIE(),llvm::DwarfCompileUnit::finishSubprogramDefinition(),llvm::DwarfCompileUnit::getOrCreateCommonBlock(),getOrCreateContextDIE(),llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(),llvm::DwarfCompileUnit::getOrCreateImportedEntityDIE(),getOrCreateModule(),getOrCreateNameSpace(),getOrCreateStaticMemberDIE(),getOrCreateSubprogramDIE(), andgetOrCreateTypeDIE().

◆ getDIELoc()

DIELoc * llvm::DwarfUnit::getDIELoc()
inline

Returns a fresh newly allocatedDIELoc.

Definition at line144 of fileDwarfUnit.h.

ReferencesDIEValueAllocator.

Referenced byapplySubprogramAttributes().

◆ getDwarfDebug()

DwarfDebug & llvm::DwarfUnit::getDwarfDebug() const
inline

Definition at line112 of fileDwarfUnit.h.

ReferencesDD.

Referenced byllvm::DwarfCompileUnit::finishEntityDefinition().

◆ getEndLabel()

MCSymbol * llvm::DwarfUnit::getEndLabel() const
inline

Definition at line109 of fileDwarfUnit.h.

ReferencesEndLabel.

Referenced byllvm::DwarfFile::emitUnit().

◆ getHeaderSize()

virtualunsigned llvm::DwarfUnit::getHeaderSize() const
inlinevirtual

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

Reimplemented inllvm::DwarfCompileUnit, andllvm::DwarfTypeUnit.

Definition at line285 of fileDwarfUnit.h.

ReferencesAsm,DD,llvm::AsmPrinter::getDwarfOffsetByteSize(), andllvm::DwarfDebug::getDwarfVersion().

Referenced byllvm::DwarfFile::computeSizeAndOffsetsForUnit(),emitCommonHeader(),llvm::DwarfCompileUnit::getHeaderSize(), andllvm::DwarfTypeUnit::getHeaderSize().

◆ getLabelBegin()

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

Get the the symbol for start of the section for this unit.

Definition at line105 of fileDwarfUnit.h.

Referencesassert(), andLabelBegin.

Referenced byllvm::emitDWARF5AccelTable().

◆ getLanguage()

uint16_t llvm::DwarfUnit::getLanguage() const
inline

Definition at line110 of fileDwarfUnit.h.

ReferencesCUNode, andllvm::DICompileUnit::getSourceLanguage().

Referenced byapplySubprogramAttributes(), andgetParentContextString().

◆ getOrCreateContextDIE()

DIE * DwarfUnit::getOrCreateContextDIE(constDIScopeContext)
virtual

Get context owner'sDIE.

Reimplemented inllvm::DwarfCompileUnit.

Definition at line546 of fileDwarfUnit.cpp.

ReferencesgetDIE(),getOrCreateModule(),getOrCreateNameSpace(),getOrCreateSubprogramDIE(),getOrCreateTypeDIE(), andllvm::DIEUnit::getUnitDie().

Referenced byconstructTypeDIE(),createTypeDIE(),llvm::DwarfCompileUnit::getOrCreateContextDIE(),getOrCreateModule(),getOrCreateNameSpace(),getOrCreateStaticMemberDIE(),getOrCreateSubprogramDIE(), andgetOrCreateTypeDIE().

◆ getOrCreateModule()

DIE * DwarfUnit::getOrCreateModule(constDIModuleM)

Definition at line1188 of fileDwarfUnit.cpp.

ReferencesaddFlag(),addGlobalName(),addString(),addUInt(),createAndAddDIE(),getDIE(),getOrCreateContextDIE(), andgetOrCreateSourceID().

Referenced byllvm::DwarfCompileUnit::constructImportedEntityDIE(), andgetOrCreateContextDIE().

◆ getOrCreateNameSpace()

DIE * DwarfUnit::getOrCreateNameSpace(constDINamespaceNS)

Definition at line1167 of fileDwarfUnit.cpp.

Referencesllvm::DwarfDebug::addAccelNamespace(),addFlag(),addGlobalName(),addString(),createAndAddDIE(),CUNode,DD,getDIE(),llvm::DINamespace::getExportSymbols(),llvm::DINamespace::getName(),llvm::DICompileUnit::getNameTableKind(),getOrCreateContextDIE(),llvm::DINamespace::getScope(), andName.

Referenced byllvm::DwarfCompileUnit::constructImportedEntityDIE(), andgetOrCreateContextDIE().

◆ getOrCreateSourceID()

virtualunsigned llvm::DwarfUnit::getOrCreateSourceID(constDIFileFile)
protectedpure virtual

Look up the source ID for the given file.

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

Implemented inllvm::DwarfCompileUnit.

Referenced byaddSourceLine(),applySubprogramDefinitionAttributes(), andgetOrCreateModule().

◆ getOrCreateStaticMemberDIE()

DIE * DwarfUnit::getOrCreateStaticMemberDIE(constDIDerivedTypeDT)
protected

Create new static data memberDIE.

Definition at line1778 of fileDwarfUnit.cpp.

ReferencesaddAccess(),addConstantFPValue(),addConstantValue(),addFlag(),addSourceLine(),addString(),addType(),addUInt(),assert(),createAndAddDIE(),getDIE(),getOrCreateContextDIE(),llvm::DIE::getTag(), andllvm::dwarf::isType().

Referenced byconstructTypeDIE(), andllvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE().

◆ getOrCreateSubprogramDIE()

DIE * DwarfUnit::getOrCreateSubprogramDIE(constDISubprogramSP,
bool Minimal =false 
)

Definition at line1219 of fileDwarfUnit.cpp.

ReferencesapplySubprogramAttributes(),createAndAddDIE(),getDIE(),getOrCreateContextDIE(),getOrCreateSubprogramDIE(),llvm::DIScope::getScope(),llvm::DIE::getUnit(), andllvm::DIEUnit::getUnitDie().

Referenced byllvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE(),llvm::DwarfCompileUnit::constructCallSiteEntryDIE(),llvm::DwarfCompileUnit::constructImportedEntityDIE(),constructTypeDIE(),getOrCreateContextDIE(),getOrCreateSubprogramDIE(), andllvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ getOrCreateTypeDIE()

DIE * DwarfUnit::getOrCreateTypeDIE(constMDNodeTyNode)
virtual

Find existingDIE or create newDIE for the given type.

Definition at line612 of fileDwarfUnit.cpp.

Referencesassert(),createTypeDIE(),DD,getBaseType(),getDIE(),llvm::DwarfDebug::getDwarfVersion(),getOrCreateContextDIE(),getOrCreateTypeDIE(), andllvm::DIE::getUnit().

Referenced byaddType(),llvm::DwarfCompileUnit::constructImportedEntityDIE(),constructTypeDIE(),getOrCreateContextDIE(), andgetOrCreateTypeDIE().

◆ getParentContextString()

std::string DwarfUnit::getParentContextString(constDIScopeContext) const

Get string containing language specific context for a global name.

Walks the metadata parent chain in a language specific manner (using the compile unit language) and returns it as a string. This is done at the metadata level because DIEs may not currently have been added to the parent context and walking the DIEs looking for names is more expensive than walking the metadata.

Definition at line681 of fileDwarfUnit.cpp.

ReferencesgetLanguage(),llvm::DIScope::getScope(),llvm::dwarf::isCPlusPlus(),Name, andllvm::reverse().

Referenced byllvm::DwarfCompileUnit::addGlobalName(),llvm::DwarfCompileUnit::addGlobalNameForTypeUnit(),llvm::DwarfCompileUnit::addGlobalTypeImpl(), andllvm::DwarfCompileUnit::addGlobalTypeUnitType().

◆ getUniqueID()

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

Gets Unique ID for this unit.

Definition at line101 of fileDwarfUnit.h.

ReferencesUniqueID.

Referenced byllvm::DwarfCompileUnit::getOrCreateSourceID(), andllvm::DwarfCompileUnit::initStmtList().

◆ hasContent()

bool llvm::DwarfUnit::hasContent() const
inline

Return true if this compile unit has something to write out.

Definition at line115 of fileDwarfUnit.h.

Referencesllvm::DIEUnit::getUnitDie(), andllvm::DIE::hasChildren().

◆ insertDIE()[1/2]

void DwarfUnit::insertDIE(constDINodeDesc,
DIED 
)

InsertDIE into the map.

We delegate the request toDwarfDebug when theMDNode can be part of the type system, since DIEs for the type system can be shared across CUs and the mappings are kept inDwarfDebug.

Definition at line202 of fileDwarfUnit.cpp.

ReferencesD,DU,llvm::DwarfFile::insertDIE(),isShareableAcrossCUs(), andMDNodeToDieMap.

Referenced byllvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs(),llvm::DwarfCompileUnit::constructImportedEntityDIE(),llvm::DwarfCompileUnit::constructLabelDIE(),llvm::DwarfCompileUnit::constructVariableDIE(),createAndAddDIE(), andllvm::DwarfCompileUnit::DwarfCompileUnit().

◆ insertDIE()[2/2]

void DwarfUnit::insertDIE(DIED)

Definition at line210 of fileDwarfUnit.cpp.

ReferencesD, andMDNodeToDieMap.

◆ isShareableAcrossCUs()

bool DwarfUnit::isShareableAcrossCUs(constDINodeD) const
protected

Check whether theDIE for thisMDNode can be shared across CUs.

Definition at line181 of fileDwarfUnit.cpp.

ReferencesD,DD,llvm::DwarfDebug::generateTypeUnits(), andllvm::DwarfDebug::shareAcrossDWOCUs().

Referenced bygetDIE(), andinsertDIE().

◆ updateAcceleratorTables()

void DwarfUnit::updateAcceleratorTables(constDIScopeContext,
constDITypeTy,
constDIETyDIE 
)

If this is a named finished type then include it in the list of types for the accelerator tables.

Definition at line639 of fileDwarfUnit.cpp.

Referencesllvm::DwarfDebug::addAccelType(),addGlobalType(),CUNode,DD,llvm::dwarf::DW_FLAG_type_implementation,llvm::StringRef::empty(),llvm::DIType::getName(),llvm::DICompileUnit::getNameTableKind(), andllvm::DIType::isForwardDecl().

Referenced bycreateTypeDIE().

◆ useSegmentedStringOffsetsTable()

bool llvm::DwarfUnit::useSegmentedStringOffsetsTable() const
inline

Definition at line279 of fileDwarfUnit.h.

ReferencesDD, andllvm::DwarfDebug::useSegmentedStringOffsetsTable().

Referenced byaddString().

Member Data Documentation

◆ Asm

AsmPrinter* llvm::DwarfUnit::Asm
protected

Target of Dwarf emission.

Definition at line46 of fileDwarfUnit.h.

Referenced byllvm::DwarfCompileUnit::addAddress(),llvm::DwarfCompileUnit::addAddrTableBase(),addAttribute(),addBlock(),llvm::DwarfCompileUnit::addComplexAddress(),addConstantValue(),llvm::DwarfCompileUnit::addLocationAttribute(),addRnglistsBase(),llvm::DwarfCompileUnit::addScopeRangeList(),addSectionLabel(),addString(),addStringOffsetsStart(),llvm::DwarfCompileUnit::applyStmtList(),applySubprogramAttributes(),llvm::DwarfCompileUnit::attachRangesOrLowHighPC(),llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs(),constructTypeDIE(),llvm::DwarfCompileUnit::DwarfCompileUnit(),emitCommonHeader(),llvm::DwarfCompileUnit::emitHeader(),llvm::DwarfTypeUnit::emitHeader(),getAsmPrinter(),getHeaderSize(),llvm::DwarfTypeUnit::getHeaderSize(),llvm::DwarfCompileUnit::getLength(),llvm::DwarfCompileUnit::getOrCreateSourceID(),llvm::DwarfCompileUnit::initStmtList(), andllvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ ContainingTypeMap

DenseMap<DIE *,constDINode *> llvm::DwarfUnit::ContainingTypeMap
protected

This map is used to keep track of subprogram DIEs that need DW_AT_containing_type attribute.

This attribute points to aDIE that corresponds to theMDNode mapped with the subprogramDIE.

Definition at line74 of fileDwarfUnit.h.

Referenced byapplySubprogramAttributes(), andconstructContainingTypeDIEs().

◆ CUNode

constDICompileUnit* llvm::DwarfUnit::CUNode
protected

MDNode for the compile unit.

Definition at line40 of fileDwarfUnit.h.

Referenced byllvm::DwarfCompileUnit::addLocationAttribute(),addString(),applySubprogramAttributes(),llvm::DwarfCompileUnit::constructImportedEntityDIE(),llvm::DwarfCompileUnit::constructInlinedScopeDIE(),llvm::DwarfCompileUnit::finishEntityDefinition(),getCUNode(),getLanguage(),getOrCreateNameSpace(),llvm::DwarfCompileUnit::hasDwarfPubSections(),llvm::DwarfCompileUnit::initStmtList(),updateAcceleratorTables(), andllvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ DD

DwarfDebug* llvm::DwarfUnit::DD
protected

Definition at line55 of fileDwarfUnit.h.

Referenced byllvm::DwarfCompileUnit::addAddrTableBase(),addAttribute(),addBlock(),addConstantValue(),addDIEEntry(),addFlag(),llvm::DwarfCompileUnit::addLabelAddress(),addLinkageName(),llvm::DwarfCompileUnit::addLocationAttribute(),llvm::DwarfCompileUnit::addLocationList(),addOpAddress(),addPoolOpAddress(),llvm::DwarfCompileUnit::addRange(),addRnglistsBase(),llvm::DwarfCompileUnit::addScopeRangeList(),addSectionDelta(),addSectionLabel(),addSectionOffset(),addString(),applySubprogramAttributes(),applySubprogramDefinitionAttributes(),llvm::DwarfCompileUnit::attachLowHighPC(),llvm::DwarfCompileUnit::attachRangesOrLowHighPC(),llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE(),llvm::DwarfCompileUnit::constructCallSiteEntryDIE(),llvm::DwarfCompileUnit::constructImportedEntityDIE(),llvm::DwarfCompileUnit::constructInlinedScopeDIE(),llvm::DwarfCompileUnit::constructLexicalScopeDIE(),llvm::DwarfCompileUnit::constructScopeDIE(),constructTypeDIE(),llvm::DwarfCompileUnit::createAndAddScopeChildren(),createTypeDIE(),emitCommonHeader(),llvm::DwarfCompileUnit::emitHeader(),llvm::DwarfTypeUnit::emitHeader(),getDwarfDebug(),getHeaderSize(),llvm::DwarfCompileUnit::getHeaderSize(),getOrCreateNameSpace(),llvm::DwarfCompileUnit::getOrCreateSourceID(),getOrCreateTypeDIE(),llvm::DwarfCompileUnit::hasDwarfPubSections(),llvm::DwarfCompileUnit::includeMinimalInlineScopes(),llvm::DwarfCompileUnit::initStmtList(),isShareableAcrossCUs(),updateAcceleratorTables(),llvm::DwarfCompileUnit::updateSubprogramScopeDIE(),llvm::DwarfCompileUnit::useGNUAnalogForDwarf5Feature(), anduseSegmentedStringOffsetsTable().

◆ DIEBlocks

std::vector<DIEBlock *> llvm::DwarfUnit::DIEBlocks
protected

A list of all the DIEBlocks in use.

Definition at line66 of fileDwarfUnit.h.

Referenced byaddBlock(), and~DwarfUnit().

◆ DIELocs

std::vector<DIELoc *> llvm::DwarfUnit::DIELocs
protected

A list of all the DIELocs in use.

Definition at line69 of fileDwarfUnit.h.

Referenced byaddBlock(), and~DwarfUnit().

◆ DIEValueAllocator

BumpPtrAllocator llvm::DwarfUnit::DIEValueAllocator
protected

Definition at line43 of fileDwarfUnit.h.

Referenced byllvm::DwarfCompileUnit::addAddress(),addAttribute(),llvm::DwarfCompileUnit::addBaseTypeRef(),llvm::DwarfCompileUnit::addComplexAddress(),addConstantValue(),llvm::DwarfCompileUnit::addLabelAddress(),addLabelDelta(),llvm::DwarfCompileUnit::addLocationAttribute(),addSectionDelta(),addString(),llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs(),llvm::DwarfCompileUnit::constructImportedEntityDIE(),llvm::DwarfCompileUnit::constructInlinedScopeDIE(),llvm::DwarfCompileUnit::constructLabelDIE(),llvm::DwarfCompileUnit::constructLexicalScopeDIE(),llvm::DwarfCompileUnit::constructSubprogramScopeDIE(),llvm::DwarfCompileUnit::constructVariableDIE(),createAndAddDIE(),llvm::DwarfCompileUnit::createBaseTypeDIEs(),getDIELoc(), andllvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ DU

DwarfFile* llvm::DwarfUnit::DU
protected

Definition at line56 of fileDwarfUnit.h.

Referenced byaddRnglistsBase(),llvm::DwarfCompileUnit::addScopeRangeList(),addString(),addStringOffsetsStart(),applySubprogramDefinitionAttributes(),llvm::DwarfCompileUnit::createAbstractEntity(),llvm::DwarfCompileUnit::createAndAddScopeChildren(),getDIE(), andinsertDIE().

◆ EndLabel

MCSymbol* llvm::DwarfUnit::EndLabel = nullptr
protected

Emitted at the end of theCU and used to compute theCU Length field.

Definition at line52 of fileDwarfUnit.h.

Referenced byllvm::DwarfCompileUnit::attachRangesOrLowHighPC(),emitCommonHeader(), andgetEndLabel().

◆ IndexTyDie

DIE* llvm::DwarfUnit::IndexTyDie = nullptr
protected

An anonymous type for index type. Owned byDIEUnit.

Definition at line59 of fileDwarfUnit.h.

◆ LabelBegin

MCSymbol* llvm::DwarfUnit::LabelBegin = nullptr
protected

The start of the unit within its section.

Definition at line49 of fileDwarfUnit.h.

Referenced byllvm::DwarfCompileUnit::emitHeader(),llvm::DwarfTypeUnit::emitHeader(), andgetLabelBegin().

◆ MDNodeToDieMap

DenseMap<constMDNode *,DIE *> llvm::DwarfUnit::MDNodeToDieMap
protected

Tracks the mapping of unit level debug information variables to debug information entries.

Definition at line63 of fileDwarfUnit.h.

Referenced bygetDIE(), andinsertDIE().

◆ UniqueID

unsigned llvm::DwarfUnit::UniqueID
protected

A numeric ID unique among all CUs in the module.

Definition at line38 of fileDwarfUnit.h.

Referenced bygetUniqueID().


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

Generated on Sun Jul 20 2025 16:06:57 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp