LLVM API Documentation

Public Member Functions | Protected Member Functions | Protected Attributes
llvm::DwarfUnit Class Reference

#include <DwarfUnit.h>

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

List of all members.

Public Member Functions

virtual ~DwarfUnit ()
 ~Unit - Destructor for compile unit.
void setSkeleton (DwarfUnit &Skel)
 Set the skeleton unit associated with this unit.
DwarfUnitgetSkeleton () const
 Get the skeleton unit associated with this unit.
void initSection (const MCSection *Section, MCSymbol *SectionSym)
const MCSectiongetSection () const
MCSymbolgetLocalSectionSym () const
MCSymbolgetSectionSym () const
MCSymbolgetLocalLabelBegin () const
MCSymbolgetLabelBegin () const
MCSymbolgetLabelEnd () const
unsigned getUniqueID () const
uint16_t getLanguage () const
DICompileUnit getCUNode () const
DIEgetUnitDie ()
const StringMap< const DIE * > & getGlobalNames () const
const StringMap< const DIE * > & getGlobalTypes () const
unsigned getDebugInfoOffset () const
void setDebugInfoOffset (unsigned DbgInfoOff)
bool hasContent () const
 hasContent - Return true if this compile unit has something to write out.
const SmallVectorImpl
< RangeSpan > & 
getRanges () const
 getRanges - Get the list of ranges for this unit.
SmallVectorImpl< RangeSpan > & getRanges ()
void addRangeList (RangeSpanList Ranges)
 addRangeList - Add an address range list to the list of range lists.
const SmallVectorImpl
< RangeSpanList > & 
getRangeLists () const
 getRangeLists - Get the vector of range lists.
SmallVectorImpl< RangeSpanList > & getRangeLists ()
std::string getParentContextString (DIScope Context) const
void addGlobalName (StringRef Name, DIE &Die, DIScope Context)
 addGlobalName - Add a new global name to the compile unit.
void addAccelNamespace (StringRef Name, const DIE &Die)
 addAccelNamespace - Add a new name to the namespace accelerator table.
DIEgetDIE (DIDescriptor D) const
DIELocgetDIELoc ()
 getDIELoc - Returns a fresh newly allocated DIELoc.
void insertDIE (DIDescriptor Desc, DIE *D)
void addFlag (DIE &Die, dwarf::Attribute Attribute)
 addFlag - Add a flag that is true to the DIE.
void addUInt (DIE &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, uint64_t Integer)
 addUInt - Add an unsigned integer attribute data and value.
void addUInt (DIE &Block, dwarf::Form Form, uint64_t Integer)
void addSInt (DIE &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, int64_t Integer)
 addSInt - Add an signed integer attribute data and value.
void addSInt (DIELoc &Die, Optional< dwarf::Form > Form, int64_t Integer)
void addString (DIE &Die, dwarf::Attribute Attribute, StringRef Str)
 addString - Add a string attribute data and value.
void addLocalString (DIE &Die, dwarf::Attribute Attribute, StringRef Str)
 addLocalString - Add a string attribute data and value.
void addExpr (DIELoc &Die, dwarf::Form Form, const MCExpr *Expr)
 addExpr - Add a Dwarf expression attribute data and value.
void addLabel (DIE &Die, dwarf::Attribute Attribute, dwarf::Form Form, const MCSymbol *Label)
 addLabel - Add a Dwarf label attribute data and value.
void addLabel (DIELoc &Die, dwarf::Form Form, const MCSymbol *Label)
void addLocationList (DIE &Die, dwarf::Attribute Attribute, unsigned Index)
 addLocationList - Add a Dwarf loclistptr attribute data and value.
void addSectionLabel (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
void addSectionOffset (DIE &Die, dwarf::Attribute Attribute, uint64_t Integer)
void addOpAddress (DIELoc &Die, const MCSymbol *Label)
void addSectionDelta (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
 addSectionDelta - Add a label delta attribute data and value.
void addLabelDelta (DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
 addLabelDelta - Add a label delta attribute data and value.
void addDIEEntry (DIE &Die, dwarf::Attribute Attribute, DIE &Entry)
 addDIEEntry - Add a DIE attribute data and value.
void addDIEEntry (DIE &Die, dwarf::Attribute Attribute, DIEEntry *Entry)
 addDIEEntry - Add a DIE attribute data and value.
void addDIETypeSignature (DIE &Die, const DwarfTypeUnit &Type)
void addBlock (DIE &Die, dwarf::Attribute Attribute, DIELoc *Block)
 addBlock - Add block data.
void addBlock (DIE &Die, dwarf::Attribute Attribute, DIEBlock *Block)
 addBlock - Add block data.
void addSourceLine (DIE &Die, unsigned Line, StringRef File, StringRef Directory)
void addSourceLine (DIE &Die, DIVariable V)
void addSourceLine (DIE &Die, DIGlobalVariable G)
void addSourceLine (DIE &Die, DISubprogram SP)
void addSourceLine (DIE &Die, DIType Ty)
void addSourceLine (DIE &Die, DINameSpace NS)
void addSourceLine (DIE &Die, DIObjCProperty Ty)
void addAddress (DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location, bool Indirect=false)
void addConstantValue (DIE &Die, const MachineOperand &MO, DIType Ty)
 addConstantValue - Add constant value entry in variable DIE.
void addConstantValue (DIE &Die, const ConstantInt *CI, DIType Ty)
 addConstantValue - Add constant value entry in variable DIE.
void addConstantValue (DIE &Die, const APInt &Val, DIType Ty)
void addConstantValue (DIE &Die, const APInt &Val, bool Unsigned)
void addConstantValue (DIE &Die, bool Unsigned, uint64_t Val)
void addConstantFPValue (DIE &Die, const MachineOperand &MO)
 addConstantFPValue - Add constant value entry in variable DIE.
void addConstantFPValue (DIE &Die, const ConstantFP *CFP)
 addConstantFPValue - Add constant value entry in variable DIE.
void addTemplateParams (DIE &Buffer, DIArray TParams)
 addTemplateParams - Add template parameters in buffer.
void addRegisterOpPiece (DIELoc &TheDie, unsigned Reg, unsigned SizeInBits=0, unsigned OffsetInBits=0)
 addRegisterOp - Add register operand.
void addRegisterOffset (DIELoc &TheDie, unsigned Reg, int64_t Offset)
 addRegisterOffset - Add register offset.
void addComplexAddress (const DbgVariable &DV, DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
void addBlockByrefAddress (const DbgVariable &DV, DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
void addVariableAddress (const DbgVariable &DV, DIE &Die, MachineLocation Location)
void addType (DIE &Entity, DIType Ty, dwarf::Attribute Attribute=dwarf::DW_AT_type)
 addType - Add a new type attribute to the specified entity.
DIEgetOrCreateNameSpace (DINameSpace NS)
 getOrCreateNameSpace - Create a DIE for DINameSpace.
DIEgetOrCreateSubprogramDIE (DISubprogram SP)
 getOrCreateSubprogramDIE - Create new DIE using SP.
void applySubprogramAttributes (DISubprogram SP, DIE &SPDie)
void applySubprogramAttributesToDefinition (DISubprogram SP, DIE &SPDie)
void applyVariableAttributes (const DbgVariable &Var, DIE &VariableDie)
DIEgetOrCreateTypeDIE (const MDNode *N)
DIEcreateTypeDIE (DICompositeType Ty)
 getOrCreateContextDIE - Get context owner's DIE.
DIEgetOrCreateContextDIE (DIScope Context)
 getOrCreateContextDIE - Get context owner's DIE.
void constructContainingTypeDIEs ()
std::unique_ptr< DIEconstructVariableDIE (DbgVariable &DV, bool Abstract=false)
 constructVariableDIE - Construct a DIE for the given DbgVariable.
void constructSubprogramArguments (DIE &Buffer, DITypeArray Args)
 constructSubprogramArguments - Construct function argument DIEs.
DIEcreateAndAddDIE (unsigned Tag, DIE &Parent, DIDescriptor N=DIDescriptor())
virtual unsigned getHeaderSize () const
virtual void emitHeader (const MCSymbol *ASectionSym) const
 Emit the header for this unit, not including the initial length field.
virtual DwarfCompileUnitgetCU ()=0
void constructTypeDIE (DIE &Buffer, DICompositeType CTy)
 constructTypeDIE - Construct type DIE from DICompositeType.

Protected Member Functions

 DwarfUnit (unsigned UID, dwarf::Tag, DICompileUnit CU, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
 Unit - Unit constructor.
DIEgetOrCreateStaticMemberDIE (DIDerivedType DT)
 getOrCreateStaticMemberDIE - Create new static data member DIE.
virtual unsigned getOrCreateSourceID (StringRef File, StringRef Directory)=0

Protected Attributes

unsigned UniqueID
 UniqueID - a numeric ID unique among all CUs in the module.
DICompileUnit CUNode
 Node - MDNode for the compile unit.
DIE UnitDie
 Unit debug information entry.
unsigned DebugInfoOffset
 Offset of the UnitDie from beginning of debug info section.
AsmPrinterAsm
 Asm - Target of Dwarf emission.
DwarfDebugDD
DwarfFileDU
DIEIndexTyDie
 IndexTyDie - An anonymous type for index type. Owned by UnitDie.
DenseMap< const MDNode *, DIE * > MDNodeToDieMap
DenseMap< const MDNode
*, DIEEntry * > 
MDNodeToDIEEntryMap
StringMap< const DIE * > GlobalNames
 GlobalNames - A map of globally visible named entities for this unit.
StringMap< const DIE * > GlobalTypes
 GlobalTypes - A map of globally visible types for this unit.
std::vector< DIEBlock * > DIEBlocks
 DIEBlocks - A list of all the DIEBlocks in use.
std::vector< DIELoc * > DIELocs
 DIELocs - A list of all the DIELocs in use.
DenseMap< DIE *, const MDNode * > ContainingTypeMap
SmallVector< RangeSpan, 1 > CURanges
SmallVector< RangeSpanList, 1 > CURangeLists
BumpPtrAllocator DIEValueAllocator
DIEIntegerDIEIntegerOne
const MCSectionSection
 The section this unit will be emitted in.
MCSymbolSectionSym
 A label at the start of the non-dwo section related to this unit.
MCSymbolLabelBegin
 The start of the unit within its section.
MCSymbolLabelEnd
 The end of the unit within its section.
DwarfUnitSkeleton
 Skeleton unit associated with this unit.

Detailed Description

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

Definition at line 67 of file DwarfUnit.h.


Constructor & Destructor Documentation

DwarfUnit::DwarfUnit ( unsigned  UID,
dwarf::Tag  UnitTag,
DICompileUnit  CU,
AsmPrinter A,
DwarfDebug DW,
DwarfFile DWU 
) [protected]

Unit - Unit constructor.

Definition at line 45 of file DwarfUnit.cpp.

References DIEIntegerOne, DIEValueAllocator, llvm::dwarf::DW_TAG_compile_unit, and llvm::dwarf::DW_TAG_type_unit.

DwarfUnit::~DwarfUnit ( ) [virtual]

~Unit - Destructor for compile unit.

Definition at line 72 of file DwarfUnit.cpp.

References DIEBlocks, and DIELocs.


Member Function Documentation

addAccelNamespace - Add a new name to the namespace accelerator table.

void DwarfUnit::addAddress ( DIE Die,
dwarf::Attribute  Attribute,
const MachineLocation Location,
bool  Indirect = false 
)
void DwarfUnit::addBlock ( DIE Die,
dwarf::Attribute  Attribute,
DIELoc Loc 
)
void DwarfUnit::addBlock ( DIE Die,
dwarf::Attribute  Attribute,
DIEBlock Block 
)

addBlock - Add block data.

Definition at line 413 of file DwarfUnit.cpp.

References llvm::DIE::addValue(), Asm, llvm::DIEBlock::BestForm(), llvm::DIEBlock::ComputeSize(), and DIEBlocks.

void DwarfUnit::addBlockByrefAddress ( const DbgVariable DV,
DIE Die,
dwarf::Attribute  Attribute,
const MachineLocation Location 
)

addBlockByrefAddress - Start with the address based on the location provided, and generate the DWARF information necessary to find the actual Block variable (navigating the Block struct) based on the starting location. Add the DWARF information to the die. Obsolete, please use addComplexAddress instead.

addBlockByrefAddress - Start with the address based on the location provided, and generate the DWARF information necessary to find the actual Block variable (navigating the Block struct) based on the starting location. Add the DWARF information to the die. For more information, read large comment just above here.

Definition at line 713 of file DwarfUnit.cpp.

References addBlock(), addRegisterOffset(), addRegisterOpPiece(), addUInt(), DIEValueAllocator, llvm::dwarf::DW_FORM_data1, llvm::dwarf::DW_FORM_udata, llvm::dwarf::DW_OP_deref, llvm::dwarf::DW_OP_plus_uconst, llvm::dwarf::DW_TAG_pointer_type, llvm::DITypedArray< T >::getElement(), llvm::DICompositeType::getElements(), llvm::DbgVariable::getName(), llvm::DITypedArray< T >::getNumElements(), llvm::MachineLocation::getOffset(), llvm::DIType::getOffsetInBits(), llvm::MachineLocation::getReg(), llvm::DIDescriptor::getTag(), llvm::DbgVariable::getType(), llvm::DIDerivedType::getTypeDerivedFrom(), llvm::MachineLocation::isReg(), and N.

Referenced by addVariableAddress().

void DwarfUnit::addComplexAddress ( const DbgVariable DV,
DIE Die,
dwarf::Attribute  Attribute,
const MachineLocation Location 
)

addComplexAddress - 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. Add the DWARF information to the die.

addComplexAddress - 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 603 of file DwarfUnit.cpp.

References addBlock(), addRegisterOffset(), addRegisterOpPiece(), addUInt(), DIEValueAllocator, llvm::dwarf::DW_FORM_data1, llvm::dwarf::DW_FORM_udata, llvm::dwarf::DW_OP_bit_piece, llvm::dwarf::DW_OP_deref, llvm::dwarf::DW_OP_plus_uconst, llvm::DbgVariable::getAddrElement(), llvm::DbgVariable::getNumAddrElements(), llvm::MachineLocation::getOffset(), llvm::DIVariable::getPieceOffset(), llvm::DIVariable::getPieceSize(), llvm::MachineLocation::getReg(), llvm::DbgVariable::getVariable(), llvm::MachineLocation::isReg(), llvm_unreachable, N, llvm::DIBuilder::OpDeref, llvm::DIBuilder::OpPiece, and llvm::DIBuilder::OpPlus.

Referenced by addVariableAddress().

void DwarfUnit::addConstantFPValue ( DIE Die,
const ConstantFP CFP 
)

addConstantFPValue - Add constant value entry in variable DIE.

Definition at line 882 of file DwarfUnit.cpp.

References addConstantValue(), llvm::APFloat::bitcastToAPInt(), and llvm::ConstantFP::getValueAPF().

void DwarfUnit::addConstantValue ( DIE Die,
const MachineOperand MO,
DIType  Ty 
)
void DwarfUnit::addConstantValue ( DIE Die,
const ConstantInt CI,
DIType  Ty 
)

addConstantValue - Add constant value entry in variable DIE.

Definition at line 888 of file DwarfUnit.cpp.

References addConstantValue(), and llvm::ConstantInt::getValue().

void DwarfUnit::addConstantValue ( DIE Die,
const APInt Val,
DIType  Ty 
)

Definition at line 907 of file DwarfUnit.cpp.

References addConstantValue(), DD, and isUnsignedDIType().

void DwarfUnit::addConstantValue ( DIE Die,
const APInt Val,
bool  Unsigned 
)
void DwarfUnit::addConstantValue ( DIE Die,
bool  Unsigned,
uint64_t  Val 
)
void DwarfUnit::addDIEEntry ( DIE Die,
dwarf::Attribute  Attribute,
DIE Entry 
)

addDIEEntry - Add a DIE attribute data and value.

Definition at line 364 of file DwarfUnit.cpp.

Referenced by addType(), applySubprogramAttributes(), constructContainingTypeDIEs(), constructTypeDIE(), and llvm::DwarfCompileUnit::createGlobalVariableDIE().

void DwarfUnit::addDIEEntry ( DIE Die,
dwarf::Attribute  Attribute,
DIEEntry Entry 
)
void DwarfUnit::addDIETypeSignature ( DIE Die,
const DwarfTypeUnit Type 
)
void DwarfUnit::addExpr ( DIELoc Die,
dwarf::Form  Form,
const MCExpr Expr 
)

addExpr - Add a Dwarf expression attribute data and value.

Definition at line 236 of file DwarfUnit.cpp.

References llvm::DIE::addValue(), and DIEValueAllocator.

Referenced by llvm::DwarfCompileUnit::createGlobalVariableDIE().

void DwarfUnit::addFlag ( DIE Die,
dwarf::Attribute  Attribute 
)
void DwarfUnit::addGlobalName ( StringRef  Name,
DIE Die,
DIScope  Context 
)

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

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

Definition at line 1075 of file DwarfUnit.cpp.

References getCUNode(), getParentContextString(), GlobalNames, llvm::DIBuilder::LineTablesOnly, and llvm::StringRef::str().

Referenced by applySubprogramAttributesToDefinition(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), and getOrCreateNameSpace().

void DwarfUnit::addLabel ( DIE Die,
dwarf::Attribute  Attribute,
dwarf::Form  Form,
const MCSymbol Label 
)

addLabel - Add a Dwarf label attribute data and value.

Definition at line 253 of file DwarfUnit.cpp.

References llvm::DIE::addValue(), and DIEValueAllocator.

Referenced by addLabel(), addOpAddress(), and addSectionLabel().

void DwarfUnit::addLabel ( DIELoc Die,
dwarf::Form  Form,
const MCSymbol Label 
)

Definition at line 259 of file DwarfUnit.cpp.

References addLabel().

void DwarfUnit::addLabelDelta ( DIE Die,
dwarf::Attribute  Attribute,
const MCSymbol Hi,
const MCSymbol Lo 
)

addLabelDelta - Add a label delta attribute data and value.

Definition at line 356 of file DwarfUnit.cpp.

References llvm::DIE::addValue(), DIEValueAllocator, and llvm::dwarf::DW_FORM_data4.

void DwarfUnit::addLocalString ( DIE Die,
dwarf::Attribute  Attribute,
StringRef  String 
)

addLocalString - Add a string attribute data and value.

addLocalString - Add a string attribute data and value. This is guaranteed to be in the local string pool instead of indirected.

Definition at line 222 of file DwarfUnit.cpp.

References llvm::DIE::addValue(), Asm, DD, DIEValueAllocator, llvm::MCAsmInfo::doesDwarfUseRelocationsAcrossSections(), DU, llvm::dwarf::DW_FORM_strp, llvm::DwarfDebug::getDebugStrSym(), llvm::DwarfFile::getStringPool(), llvm::DwarfStringPool::getSymbol(), and llvm::AsmPrinter::MAI.

Referenced by addString().

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

addLocationList - Add a Dwarf loclistptr attribute data and value.

Definition at line 243 of file DwarfUnit.cpp.

References llvm::DIE::addValue(), DD, DIEValueAllocator, llvm::dwarf::DW_FORM_data4, llvm::dwarf::DW_FORM_sec_offset, and llvm::DwarfDebug::getDwarfVersion().

void DwarfUnit::addOpAddress ( DIELoc Die,
const MCSymbol Sym 
)

addOpAddress - 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 line 335 of file DwarfUnit.cpp.

References addLabel(), addUInt(), DD, llvm::dwarf::DW_FORM_data1, llvm::dwarf::DW_FORM_GNU_addr_index, llvm::dwarf::DW_FORM_udata, llvm::dwarf::DW_OP_addr, llvm::dwarf::DW_OP_GNU_addr_index, llvm::DwarfDebug::getAddressPool(), llvm::AddressPool::getIndex(), and llvm::DwarfDebug::useSplitDwarf().

Referenced by llvm::DwarfCompileUnit::createGlobalVariableDIE().

void llvm::DwarfUnit::addRangeList ( RangeSpanList  Ranges) [inline]

addRangeList - Add an address range list to the list of range lists.

Definition at line 224 of file DwarfUnit.h.

References CURangeLists, and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

void DwarfUnit::addRegisterOffset ( DIELoc TheDie,
unsigned  Reg,
int64_t  Offset 
)
void DwarfUnit::addRegisterOpPiece ( DIELoc TheDie,
unsigned  Reg,
unsigned  SizeInBits = 0,
unsigned  OffsetInBits = 0 
)
void DwarfUnit::addSectionDelta ( DIE Die,
dwarf::Attribute  Attribute,
const MCSymbol Hi,
const MCSymbol Lo 
)

addSectionDelta - Add a label delta attribute data and value.

addSectionDelta - Add a section label delta attribute data and value.

Definition at line 348 of file DwarfUnit.cpp.

References llvm::DIE::addValue(), DD, DIEValueAllocator, llvm::dwarf::DW_FORM_data4, llvm::dwarf::DW_FORM_sec_offset, and llvm::DwarfDebug::getDwarfVersion().

Referenced by addSectionLabel(), and llvm::DwarfCompileUnit::initStmtList().

void DwarfUnit::addSectionLabel ( DIE Die,
dwarf::Attribute  Attribute,
const MCSymbol Label 
)

addSectionLabel - Add a Dwarf section label attribute data and value.

Definition at line 265 of file DwarfUnit.cpp.

References addLabel(), DD, llvm::dwarf::DW_FORM_data4, llvm::dwarf::DW_FORM_sec_offset, and llvm::DwarfDebug::getDwarfVersion().

Referenced by addSectionLabel(), and llvm::DwarfCompileUnit::initStmtList().

void DwarfUnit::addSectionOffset ( DIE Die,
dwarf::Attribute  Attribute,
uint64_t  Integer 
)

addSectionOffset - Add an offset into a section attribute data and value.

Definition at line 275 of file DwarfUnit.cpp.

References addUInt(), DD, llvm::dwarf::DW_FORM_data4, llvm::dwarf::DW_FORM_sec_offset, and llvm::DwarfDebug::getDwarfVersion().

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

void DwarfUnit::addSInt ( DIE Die,
dwarf::Attribute  Attribute,
Optional< dwarf::Form Form,
int64_t  Integer 
)

addSInt - Add an signed integer attribute data and value.

Definition at line 190 of file DwarfUnit.cpp.

References llvm::DIE::addValue(), llvm::DIEInteger::BestForm(), and DIEValueAllocator.

Referenced by addRegisterOffset(), and addSInt().

void DwarfUnit::addSInt ( DIELoc Die,
Optional< dwarf::Form Form,
int64_t  Integer 
)

Definition at line 198 of file DwarfUnit.cpp.

References addSInt().

void DwarfUnit::addSourceLine ( DIE Die,
unsigned  Line,
StringRef  File,
StringRef  Directory 
)
void DwarfUnit::addSourceLine ( DIE Die,
DIVariable  V 
)

addSourceLine - Add location information to specified debug information entry.

Definition at line 435 of file DwarfUnit.cpp.

References addSourceLine(), llvm::DIVariable::getContext(), llvm::DIScope::getDirectory(), llvm::DIScope::getFilename(), llvm::DIVariable::getLineNumber(), and llvm::DIDescriptor::isVariable().

addSourceLine - Add location information to specified debug information entry.

Definition at line 444 of file DwarfUnit.cpp.

References addSourceLine(), llvm::DIGlobalVariable::getDirectory(), llvm::DIGlobalVariable::getFilename(), llvm::DIGlobalVariable::getLineNumber(), and llvm::DIDescriptor::isGlobalVariable().

void DwarfUnit::addSourceLine ( DIE Die,
DISubprogram  SP 
)

addSourceLine - Add location information to specified debug information entry.

Definition at line 452 of file DwarfUnit.cpp.

References addSourceLine(), llvm::DIScope::getDirectory(), llvm::DIScope::getFilename(), llvm::DISubprogram::getLineNumber(), and llvm::DIDescriptor::isSubprogram().

void DwarfUnit::addSourceLine ( DIE Die,
DIType  Ty 
)

addSourceLine - Add location information to specified debug information entry.

Definition at line 460 of file DwarfUnit.cpp.

References addSourceLine(), llvm::DIScope::getDirectory(), llvm::DIScope::getFilename(), llvm::DIType::getLineNumber(), and llvm::DIDescriptor::isType().

void DwarfUnit::addSourceLine ( DIE Die,
DINameSpace  NS 
)

addSourceLine - Add location information to specified debug information entry.

Definition at line 478 of file DwarfUnit.cpp.

References addSourceLine(), llvm::DIScope::getDirectory(), llvm::DIScope::getFilename(), llvm::DINameSpace::getLineNumber(), and llvm::DINameSpace::Verify().

void DwarfUnit::addSourceLine ( DIE Die,
DIObjCProperty  Ty 
)

addSourceLine - Add location information to specified debug information entry.

Definition at line 468 of file DwarfUnit.cpp.

References addSourceLine(), llvm::ARMBuildAttrs::File, llvm::DIObjCProperty::getFile(), llvm::DIObjCProperty::getLineNumber(), and llvm::DIDescriptor::isObjCProperty().

void DwarfUnit::addString ( DIE Die,
dwarf::Attribute  Attribute,
StringRef  String 
)

addString - Add a string attribute data and value.

addString - 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 line 208 of file DwarfUnit.cpp.

References addLocalString(), llvm::DIE::addValue(), Asm, DD, DIEValueAllocator, DU, llvm::dwarf::DW_FORM_GNU_str_index, llvm::DwarfStringPool::getIndex(), llvm::DwarfFile::getStringPool(), and llvm::DwarfDebug::useSplitDwarf().

Referenced by applySubprogramAttributes(), applyVariableAttributes(), constructTypeDIE(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), getOrCreateNameSpace(), and getOrCreateStaticMemberDIE().

void DwarfUnit::addTemplateParams ( DIE Buffer,
DIArray  TParams 
)

addTemplateParams - Add template parameters in buffer.

addTemplateParams - Add template parameters into buffer.

Definition at line 942 of file DwarfUnit.cpp.

References llvm::DITypedArray< T >::getElement(), llvm::DITypedArray< T >::getNumElements(), llvm::DIDescriptor::isTemplateTypeParameter(), and llvm::DIDescriptor::isTemplateValueParameter().

Referenced by applySubprogramAttributes(), and constructTypeDIE().

void DwarfUnit::addType ( DIE Entity,
DIType  Ty,
dwarf::Attribute  Attribute = dwarf::DW_AT_type 
)

addType - Add a new type attribute to the specified entity.

addType - 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 line 1054 of file DwarfUnit.cpp.

References addDIEEntry(), and getOrCreateTypeDIE().

Referenced by applySubprogramAttributes(), applyVariableAttributes(), constructSubprogramArguments(), constructTypeDIE(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), and getOrCreateStaticMemberDIE().

void DwarfUnit::addUInt ( DIE Die,
dwarf::Attribute  Attribute,
Optional< dwarf::Form Form,
uint64_t  Integer 
)
void DwarfUnit::addUInt ( DIE Block,
dwarf::Form  Form,
uint64_t  Integer 
)

Definition at line 184 of file DwarfUnit.cpp.

References addUInt().

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

Definition at line 1451 of file DwarfUnit.cpp.

References addBlock(), addDIEEntry(), addFlag(), addSourceLine(), addString(), addTemplateParams(), addType(), addUInt(), Asm, constructSubprogramArguments(), ContainingTypeMap, llvm::dwarf::DW_ACCESS_private, llvm::dwarf::DW_ACCESS_protected, llvm::dwarf::DW_ACCESS_public, llvm::dwarf::DW_AT_accessibility, llvm::dwarf::DW_AT_APPLE_isa, llvm::dwarf::DW_AT_APPLE_optimized, llvm::dwarf::DW_AT_artificial, llvm::dwarf::DW_AT_declaration, llvm::dwarf::DW_AT_explicit, llvm::dwarf::DW_AT_external, llvm::dwarf::DW_AT_MIPS_linkage_name, llvm::dwarf::DW_AT_name, llvm::dwarf::DW_AT_prototyped, llvm::dwarf::DW_AT_reference, llvm::dwarf::DW_AT_rvalue_reference, llvm::dwarf::DW_AT_specification, llvm::dwarf::DW_AT_virtuality, llvm::dwarf::DW_AT_vtable_elem_location, llvm::dwarf::DW_FORM_data1, llvm::dwarf::DW_FORM_flag, llvm::dwarf::DW_FORM_udata, llvm::dwarf::DW_LANG_C89, llvm::dwarf::DW_LANG_C99, llvm::dwarf::DW_LANG_ObjC, llvm::dwarf::DW_OP_constu, llvm::dwarf::DW_TAG_subroutine_type, llvm::StringRef::empty(), llvm::DISubprogram::getContainingType(), getDIE(), getDIELoc(), llvm::DISubprogram::getFunctionDeclaration(), llvm::AsmPrinter::getISAEncoding(), getLanguage(), llvm::DISubprogram::getLinkageName(), llvm::DISubprogram::getName(), llvm::GlobalValue::getRealLinkageName(), llvm::DIDescriptor::getTag(), llvm::DISubprogram::getTemplateParams(), llvm::DISubprogram::getType(), llvm::DISubroutineType::getTypeArray(), llvm::DISubprogram::getVirtualIndex(), llvm::DISubprogram::getVirtuality(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::insert(), llvm::isa(), llvm::DISubprogram::isArtificial(), llvm::DISubprogram::isDefinition(), llvm::DISubprogram::isExplicit(), llvm::DISubprogram::isLocalToUnit(), llvm::DISubprogram::isLValueReference(), llvm::DISubprogram::isOptimized(), llvm::DISubprogram::isPrivate(), llvm::DISubprogram::isProtected(), llvm::DISubprogram::isPrototyped(), llvm::DISubprogram::isPublic(), and llvm::DISubprogram::isRValueReference().

Referenced by applySubprogramAttributesToDefinition(), and getOrCreateSubprogramDIE().

void DwarfUnit::applyVariableAttributes ( const DbgVariable Var,
DIE VariableDie 
)
void DwarfUnit::constructTypeDIE ( DIE Buffer,
DICompositeType  CTy 
)

constructTypeDIE - Construct type DIE from DICompositeType.

Definition at line 1188 of file DwarfUnit.cpp.

References addDIEEntry(), addFlag(), addSourceLine(), addString(), addTemplateParams(), addType(), addUInt(), constructSubprogramArguments(), createAndAddDIE(), llvm::dwarf::DW_APPLE_PROPERTY_assign, llvm::dwarf::DW_APPLE_PROPERTY_copy, llvm::dwarf::DW_APPLE_PROPERTY_nonatomic, llvm::dwarf::DW_APPLE_PROPERTY_readonly, llvm::dwarf::DW_APPLE_PROPERTY_readwrite, llvm::dwarf::DW_APPLE_PROPERTY_retain, llvm::dwarf::DW_AT_APPLE_block, llvm::dwarf::DW_AT_APPLE_objc_complete_type, llvm::dwarf::DW_AT_APPLE_property_attribute, llvm::dwarf::DW_AT_APPLE_property_getter, llvm::dwarf::DW_AT_APPLE_property_name, llvm::dwarf::DW_AT_APPLE_property_setter, llvm::dwarf::DW_AT_APPLE_runtime_class, llvm::dwarf::DW_AT_byte_size, llvm::dwarf::DW_AT_containing_type, llvm::dwarf::DW_AT_declaration, llvm::dwarf::DW_AT_friend, llvm::dwarf::DW_AT_name, llvm::dwarf::DW_AT_prototyped, llvm::dwarf::DW_AT_reference, llvm::dwarf::DW_AT_rvalue_reference, llvm::dwarf::DW_FORM_data1, llvm::dwarf::DW_LANG_C89, llvm::dwarf::DW_LANG_C99, llvm::dwarf::DW_LANG_ObjC, llvm::dwarf::DW_TAG_array_type, llvm::dwarf::DW_TAG_class_type, llvm::dwarf::DW_TAG_enumeration_type, llvm::dwarf::DW_TAG_friend, llvm::dwarf::DW_TAG_structure_type, llvm::dwarf::DW_TAG_subroutine_type, llvm::dwarf::DW_TAG_union_type, llvm::StringRef::empty(), llvm::DICompositeType::getContainingType(), llvm::DITypedArray< T >::getElement(), llvm::DICompositeType::getElements(), getLanguage(), llvm::DIType::getName(), llvm::DITypedArray< T >::getNumElements(), llvm::DIObjCProperty::getObjCPropertyGetterName(), llvm::DIObjCProperty::getObjCPropertyName(), llvm::DIObjCProperty::getObjCPropertySetterName(), getOrCreateStaticMemberDIE(), getOrCreateSubprogramDIE(), getOrCreateTypeDIE(), llvm::DICompositeType::getRunTimeLang(), llvm::DIType::getSizeInBits(), llvm::DIDescriptor::getTag(), llvm::DIE::getTag(), llvm::DICompositeType::getTemplateParams(), llvm::DIObjCProperty::getType(), llvm::DISubroutineType::getTypeArray(), llvm::DIDerivedType::getTypeDerivedFrom(), llvm::DIType::isAppleBlockExtension(), llvm::DIObjCProperty::isAssignObjCProperty(), llvm::DIObjCProperty::isCopyObjCProperty(), llvm::DIDescriptor::isDerivedType(), llvm::DIType::isForwardDecl(), llvm::DIType::isLValueReference(), llvm::DIObjCProperty::isNonAtomicObjCProperty(), llvm::DIType::isObjcClassComplete(), llvm::DIDescriptor::isObjCProperty(), llvm::DIObjCProperty::isReadOnlyObjCProperty(), llvm::DIObjCProperty::isReadWriteObjCProperty(), llvm::DIObjCProperty::isRetainObjCProperty(), llvm::DIType::isRValueReference(), llvm::DIType::isStaticMember(), llvm::DIDescriptor::isSubprogram(), N, and llvm::None.

Referenced by llvm::DwarfDebug::addDwarfTypeUnitType(), createTypeDIE(), and getOrCreateTypeDIE().

std::unique_ptr< DIE > DwarfUnit::constructVariableDIE ( DbgVariable DV,
bool  Abstract = false 
)

constructVariableDIE - Construct a DIE for the given DbgVariable.

Definition at line 1832 of file DwarfUnit.cpp.

References llvm::DbgVariable::setDIE().

Referenced by constructVariableDIE().

getOrCreateContextDIE - Get context owner's DIE.

Definition at line 968 of file DwarfUnit.cpp.

References constructTypeDIE(), createAndAddDIE(), llvm::DIType::getContext(), getDIE(), getOrCreateContextDIE(), and llvm::DIDescriptor::getTag().

void DwarfUnit::emitHeader ( const MCSymbol ASectionSym) const [virtual]
virtual DwarfCompileUnit& llvm::DwarfUnit::getCU ( ) [pure virtual]

Definition at line 208 of file DwarfUnit.h.

References CUNode.

Referenced by addGlobalName(), and llvm::DwarfCompileUnit::addRange().

Definition at line 213 of file DwarfUnit.h.

References DebugInfoOffset.

getDIE - Returns the debug information entry map slot for the specified debug variable. We delegate the request to DwarfDebug when the MDNode can be part of the type system, since DIEs for the type system can be shared across CUs and the mappings are kept in DwarfDebug.

getDIE - Returns the debug information entry map slot for the specified debug variable. We delegate the request to DwarfDebug when the DIE for this MDNode can be shared across CUs. The mappings will be kept in DwarfDebug for shareable DIEs.

Definition at line 148 of file DwarfUnit.cpp.

References DD, llvm::DwarfDebug::getDIE(), isShareableAcrossCUs(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::lookup(), and MDNodeToDieMap.

Referenced by applySubprogramAttributes(), constructContainingTypeDIEs(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), createTypeDIE(), getOrCreateContextDIE(), getOrCreateNameSpace(), getOrCreateStaticMemberDIE(), getOrCreateSubprogramDIE(), and getOrCreateTypeDIE().

getDIELoc - Returns a fresh newly allocated DIELoc.

Definition at line 251 of file DwarfUnit.h.

References DIEValueAllocator.

Referenced by applySubprogramAttributes().

Definition at line 210 of file DwarfUnit.h.

References GlobalNames.

Definition at line 211 of file DwarfUnit.h.

References GlobalTypes.

virtual unsigned llvm::DwarfUnit::getHeaderSize ( ) const [inline, virtual]

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

Reimplemented in llvm::DwarfTypeUnit.

Definition at line 432 of file DwarfUnit.h.

Definition at line 195 of file DwarfUnit.h.

References LabelBegin, and Section.

Referenced by getLocalLabelBegin().

Definition at line 200 of file DwarfUnit.h.

References LabelEnd, and Section.

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

If there's a skeleton then return the begin label for the skeleton unit, otherwise return the local label for this unit.

Definition at line 189 of file DwarfUnit.h.

References getLabelBegin(), and Skeleton.

If there's a skeleton then return the section symbol for the skeleton unit, otherwise return the section symbol for this unit.

Definition at line 176 of file DwarfUnit.h.

References getSectionSym(), and Skeleton.

virtual unsigned llvm::DwarfUnit::getOrCreateSourceID ( StringRef  File,
StringRef  Directory 
) [protected, pure virtual]

Look up the source ID with the given directory and source file names. If none currently exists, create a new ID and insert it in the line table.

Implemented in llvm::DwarfTypeUnit, and llvm::DwarfCompileUnit.

Referenced by addSourceLine().

std::string DwarfUnit::getParentContextString ( DIScope  Context) const

getParentContextString - Get a string containing the language specific context for a global name.

getParentContextString - 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 line 1087 of file DwarfUnit.cpp.

References llvm::dwarf::DW_LANG_C_plus_plus, llvm::StringRef::empty(), llvm::DIScope::getContext(), getLanguage(), llvm::DIScope::getName(), I, llvm::DIDescriptor::isCompileUnit(), llvm::DIDescriptor::isNameSpace(), Name, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorTemplateCommon< T >::rbegin(), and llvm::SmallVectorTemplateCommon< T >::rend().

Referenced by addGlobalName().

getRangeLists - Get the vector of range lists.

Definition at line 227 of file DwarfUnit.h.

References CURangeLists.

Definition at line 230 of file DwarfUnit.h.

References CURangeLists.

getRanges - Get the list of ranges for this unit.

Definition at line 220 of file DwarfUnit.h.

References CURanges.

Definition at line 221 of file DwarfUnit.h.

References CURanges.

Definition at line 169 of file DwarfUnit.h.

References Section.

Definition at line 182 of file DwarfUnit.h.

References Section, and SectionSym.

Referenced by getLocalSectionSym().

Get the skeleton unit associated with this unit.

Definition at line 154 of file DwarfUnit.h.

References Skeleton.

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

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

Definition at line 217 of file DwarfUnit.h.

References llvm::DIE::getChildren(), and UnitDie.

void llvm::DwarfUnit::initSection ( const MCSection Section,
MCSymbol SectionSym 
) [inline]

Pass in the SectionSym even though we could recreate it in every compile unit (type units will have actually distinct symbols once they're in comdat sections).

Definition at line 159 of file DwarfUnit.h.

References Asm, llvm::MCSection::getLabelBeginName(), llvm::MCSection::getLabelEndName(), llvm::AsmPrinter::GetTempSymbol(), getUniqueID(), LabelBegin, LabelEnd, Section, and SectionSym.

void DwarfUnit::insertDIE ( DIDescriptor  Desc,
DIE D 
)

insertDIE - Insert DIE into the map. We delegate the request to DwarfDebug when the MDNode can be part of the type system, since DIEs for the type system can be shared across CUs and the mappings are kept in DwarfDebug.

insertDIE - Insert DIE into the map. We delegate the request to DwarfDebug when the DIE for this MDNode can be shared across CUs. The mappings will be kept in DwarfDebug for shareable DIEs.

Definition at line 157 of file DwarfUnit.cpp.

References DD, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::insert(), llvm::DwarfDebug::insertDIE(), isShareableAcrossCUs(), and MDNodeToDieMap.

Referenced by createAndAddDIE(), and llvm::DwarfCompileUnit::DwarfCompileUnit().

void llvm::DwarfUnit::setDebugInfoOffset ( unsigned  DbgInfoOff) [inline]

Definition at line 214 of file DwarfUnit.h.

References DebugInfoOffset.

void llvm::DwarfUnit::setSkeleton ( DwarfUnit Skel) [inline]

Set the skeleton unit associated with this unit.

Definition at line 151 of file DwarfUnit.h.

References Skeleton.


Member Data Documentation

ContainingTypeMap - This map is used to keep track of subprogram DIEs that need DW_AT_containing_type attribute. This attribute points to a DIE that corresponds to the MDNode mapped with the subprogram DIE.

Definition at line 114 of file DwarfUnit.h.

Referenced by applySubprogramAttributes(), and constructContainingTypeDIEs().

Node - MDNode for the compile unit.

Definition at line 73 of file DwarfUnit.h.

Referenced by getCUNode(), and getLanguage().

Definition at line 121 of file DwarfUnit.h.

Referenced by addRangeList(), and getRangeLists().

Definition at line 117 of file DwarfUnit.h.

Referenced by llvm::DwarfCompileUnit::addRange(), and getRanges().

Offset of the UnitDie from beginning of debug info section.

Definition at line 79 of file DwarfUnit.h.

Referenced by getDebugInfoOffset(), and setDebugInfoOffset().

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

DIEBlocks - A list of all the DIEBlocks in use.

Definition at line 106 of file DwarfUnit.h.

Referenced by addBlock(), and ~DwarfUnit().

Definition at line 127 of file DwarfUnit.h.

Referenced by addFlag(), addUInt(), and DwarfUnit().

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

DIELocs - A list of all the DIELocs in use.

Definition at line 109 of file DwarfUnit.h.

Referenced by addBlock(), and ~DwarfUnit().

Definition at line 86 of file DwarfUnit.h.

Referenced by addLocalString(), and addString().

GlobalNames - A map of globally visible named entities for this unit.

Definition at line 100 of file DwarfUnit.h.

Referenced by addGlobalName(), and getGlobalNames().

GlobalTypes - A map of globally visible types for this unit.

Definition at line 103 of file DwarfUnit.h.

Referenced by getGlobalTypes().

IndexTyDie - An anonymous type for index type. Owned by UnitDie.

Definition at line 89 of file DwarfUnit.h.

The start of the unit within its section.

Definition at line 136 of file DwarfUnit.h.

Referenced by getLabelBegin(), initSection(), and llvm::DwarfTypeUnit::initSection().

The end of the unit within its section.

Definition at line 139 of file DwarfUnit.h.

Referenced by getLabelEnd(), initSection(), and llvm::DwarfTypeUnit::initSection().

MDNodeToDIEEntryMap - Tracks the mapping of unit level debug information descriptors to debug information entries using a DIEEntry proxy.

Definition at line 97 of file DwarfUnit.h.

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

Definition at line 93 of file DwarfUnit.h.

Referenced by getDIE(), and insertDIE().

The section this unit will be emitted in.

Definition at line 130 of file DwarfUnit.h.

Referenced by getLabelBegin(), getLabelEnd(), getSection(), getSectionSym(), initSection(), and llvm::DwarfTypeUnit::initSection().

A label at the start of the non-dwo section related to this unit.

Definition at line 133 of file DwarfUnit.h.

Referenced by getSectionSym(), initSection(), and llvm::DwarfTypeUnit::initSection().

Skeleton unit associated with this unit.

Definition at line 142 of file DwarfUnit.h.

Referenced by llvm::DwarfCompileUnit::addLabelAddress(), getLocalLabelBegin(), getLocalSectionSym(), getSkeleton(), and setSkeleton().

UniqueID - a numeric ID unique among all CUs in the module.

Definition at line 70 of file DwarfUnit.h.

Referenced by getUniqueID().


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