LLVM API Documentation
#include <DwarfUnit.h>
Public Member Functions | |
virtual | ~DwarfUnit () |
~Unit - Destructor for compile unit. | |
void | setSkeleton (DwarfUnit &Skel) |
Set the skeleton unit associated with this unit. | |
DwarfUnit * | getSkeleton () const |
Get the skeleton unit associated with this unit. | |
void | initSection (const MCSection *Section, MCSymbol *SectionSym) |
const MCSection * | getSection () const |
MCSymbol * | getLocalSectionSym () const |
MCSymbol * | getSectionSym () const |
MCSymbol * | getLocalLabelBegin () const |
MCSymbol * | getLabelBegin () const |
MCSymbol * | getLabelEnd () const |
unsigned | getUniqueID () const |
uint16_t | getLanguage () const |
DICompileUnit | getCUNode () const |
DIE & | getUnitDie () |
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. | |
DIE * | getDIE (DIDescriptor D) const |
DIELoc * | getDIELoc () |
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. | |
DIE * | getOrCreateNameSpace (DINameSpace NS) |
getOrCreateNameSpace - Create a DIE for DINameSpace. | |
DIE * | getOrCreateSubprogramDIE (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) |
DIE * | getOrCreateTypeDIE (const MDNode *N) |
DIE * | createTypeDIE (DICompositeType Ty) |
getOrCreateContextDIE - Get context owner's DIE. | |
DIE * | getOrCreateContextDIE (DIScope Context) |
getOrCreateContextDIE - Get context owner's DIE. | |
void | constructContainingTypeDIEs () |
std::unique_ptr< DIE > | constructVariableDIE (DbgVariable &DV, bool Abstract=false) |
constructVariableDIE - Construct a DIE for the given DbgVariable. | |
void | constructSubprogramArguments (DIE &Buffer, DITypeArray Args) |
constructSubprogramArguments - Construct function argument DIEs. | |
DIE & | createAndAddDIE (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 DwarfCompileUnit & | getCU ()=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. | |
DIE * | getOrCreateStaticMemberDIE (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. | |
AsmPrinter * | Asm |
Asm - Target of Dwarf emission. | |
DwarfDebug * | DD |
DwarfFile * | DU |
DIE * | IndexTyDie |
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 |
DIEInteger * | DIEIntegerOne |
const MCSection * | Section |
The section this unit will be emitted in. | |
MCSymbol * | SectionSym |
A label at the start of the non-dwo section related to this unit. | |
MCSymbol * | LabelBegin |
The start of the unit within its section. | |
MCSymbol * | LabelEnd |
The end of the unit within its section. | |
DwarfUnit * | Skeleton |
Skeleton unit associated with this unit. |
Unit - This dwarf writer support class manages information associated with a source file.
Definition at line 67 of file DwarfUnit.h.
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.
void llvm::DwarfUnit::addAccelNamespace | ( | StringRef | Name, |
const DIE & | Die | ||
) |
addAccelNamespace - Add a new name to the namespace accelerator table.
void DwarfUnit::addAddress | ( | DIE & | Die, |
dwarf::Attribute | Attribute, | ||
const MachineLocation & | Location, | ||
bool | Indirect = false |
||
) |
addAddress - Add an address attribute to a die based on the location provided.
Definition at line 581 of file DwarfUnit.cpp.
References addBlock(), addRegisterOffset(), addRegisterOpPiece(), addUInt(), DIEValueAllocator, llvm::dwarf::DW_FORM_data1, llvm::dwarf::DW_OP_deref, llvm::MachineLocation::getOffset(), llvm::MachineLocation::getReg(), and llvm::MachineLocation::isReg().
Referenced by addVariableAddress().
void DwarfUnit::addBlock | ( | DIE & | Die, |
dwarf::Attribute | Attribute, | ||
DIELoc * | Loc | ||
) |
addBlock - Add block data.
Definition at line 407 of file DwarfUnit.cpp.
References llvm::DIE::addValue(), Asm, llvm::DIELoc::BestForm(), llvm::DIELoc::ComputeSize(), DD, DIELocs, and llvm::DwarfDebug::getDwarfVersion().
Referenced by addAddress(), addBlockByrefAddress(), addComplexAddress(), addConstantFPValue(), addConstantValue(), applySubprogramAttributes(), and llvm::DwarfCompileUnit::createGlobalVariableDIE().
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 MachineOperand & | MO | ||
) |
addConstantFPValue - Add constant value entry in variable DIE.
Definition at line 859 of file DwarfUnit.cpp.
References addBlock(), addUInt(), Asm, llvm::APFloat::bitcastToAPInt(), DIEValueAllocator, llvm::dwarf::DW_AT_const_value, llvm::dwarf::DW_FORM_data1, llvm::APInt::getBitWidth(), llvm::AsmPrinter::getDataLayout(), llvm::MachineOperand::getFPImm(), llvm::APInt::getRawData(), llvm::ConstantFP::getValueAPF(), llvm::MachineOperand::isFPImm(), and llvm::DataLayout::isLittleEndian().
Referenced by getOrCreateStaticMemberDIE().
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 | ||
) |
addConstantValue - Add constant value entry in variable DIE.
Definition at line 893 of file DwarfUnit.cpp.
References DD, llvm::MachineOperand::getImm(), llvm::MachineOperand::isImm(), and isUnsignedDIType().
Referenced by addConstantFPValue(), addConstantValue(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), and getOrCreateStaticMemberDIE().
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 | ||
) |
Definition at line 912 of file DwarfUnit.cpp.
References addBlock(), addConstantValue(), addUInt(), Asm, DIEValueAllocator, llvm::dwarf::DW_AT_const_value, llvm::dwarf::DW_FORM_data1, llvm::APInt::getBitWidth(), llvm::AsmPrinter::getDataLayout(), llvm::APInt::getRawData(), llvm::APInt::getSExtValue(), llvm::APInt::getZExtValue(), and llvm::DataLayout::isLittleEndian().
void DwarfUnit::addConstantValue | ( | DIE & | Die, |
bool | Unsigned, | ||
uint64_t | Val | ||
) |
Definition at line 900 of file DwarfUnit.cpp.
References addUInt(), llvm::dwarf::DW_AT_const_value, llvm::dwarf::DW_FORM_sdata, and llvm::dwarf::DW_FORM_udata.
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 | ||
) |
addDIEEntry - Add a DIE attribute data and value.
Definition at line 379 of file DwarfUnit.cpp.
References llvm::DIE::addValue(), llvm::dwarf::DW_FORM_ref4, llvm::dwarf::DW_FORM_ref_addr, llvm::DIEEntry::getEntry(), getUnitDie(), and llvm::DIE::getUnitOrNull().
void DwarfUnit::addDIETypeSignature | ( | DIE & | Die, |
const DwarfTypeUnit & | Type | ||
) |
Definition at line 368 of file DwarfUnit.cpp.
References addFlag(), llvm::DIE::addValue(), DIEValueAllocator, llvm::dwarf::DW_AT_declaration, llvm::dwarf::DW_AT_signature, and llvm::dwarf::DW_FORM_ref_sig8.
Referenced by llvm::DwarfDebug::addDwarfTypeUnitType().
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 | ||
) |
addFlag - Add a flag that is true to the DIE.
addFlag - Add a flag that is true.
Definition at line 166 of file DwarfUnit.cpp.
References llvm::DIE::addValue(), DD, DIEIntegerOne, llvm::dwarf::DW_FORM_flag, llvm::dwarf::DW_FORM_flag_present, and llvm::DwarfDebug::getDwarfVersion().
Referenced by addDIETypeSignature(), applySubprogramAttributes(), applyVariableAttributes(), constructSubprogramArguments(), constructTypeDIE(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), llvm::DwarfDebug::endFunction(), and getOrCreateStaticMemberDIE().
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 | ||
) |
addRegisterOffset - Add register offset.
Definition at line 562 of file DwarfUnit.cpp.
References addSInt(), addUInt(), Asm, llvm::dwarf::DW_FORM_data1, llvm::dwarf::DW_FORM_sdata, llvm::dwarf::DW_FORM_udata, llvm::dwarf::DW_OP_breg0, llvm::dwarf::DW_OP_bregx, llvm::dwarf::DW_OP_fbreg, llvm::MCRegisterInfo::getDwarfRegNum(), llvm::TargetRegisterInfo::getFrameRegister(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::TargetMachine::getSubtargetImpl(), llvm::AsmPrinter::MF, and llvm::AsmPrinter::TM.
Referenced by addAddress(), addBlockByrefAddress(), and addComplexAddress().
void DwarfUnit::addRegisterOpPiece | ( | DIELoc & | TheDie, |
unsigned | Reg, | ||
unsigned | SizeInBits = 0 , |
||
unsigned | OffsetInBits = 0 |
||
) |
addRegisterOp - Add register operand.
Definition at line 500 of file DwarfUnit.cpp.
References addUInt(), Asm, llvm::dbgs(), DEBUG, llvm::dwarf::DW_FORM_data1, llvm::dwarf::DW_FORM_udata, llvm::dwarf::DW_OP_bit_piece, llvm::dwarf::DW_OP_constu, llvm::dwarf::DW_OP_nop, llvm::dwarf::DW_OP_piece, llvm::dwarf::DW_OP_reg0, llvm::dwarf::DW_OP_regx, llvm::dwarf::DW_OP_shr, llvm::MCRegisterInfo::getDwarfRegNum(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MCRegisterInfo::getSubRegIdxOffset(), llvm::MCRegisterInfo::getSubRegIdxSize(), llvm::MCRegisterInfo::getSubRegIndex(), llvm::TargetMachine::getSubtargetImpl(), llvm::MCRegisterInfo::DiffListIterator::isValid(), and llvm::AsmPrinter::TM.
Referenced by addAddress(), addBlockByrefAddress(), and addComplexAddress().
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 | ||
) |
addSourceLine - Add location information to specified debug information entry.
Definition at line 422 of file DwarfUnit.cpp.
References addUInt(), llvm::dwarf::DW_AT_decl_file, llvm::dwarf::DW_AT_decl_line, getOrCreateSourceID(), and llvm::None.
Referenced by addSourceLine(), applySubprogramAttributes(), applyVariableAttributes(), constructTypeDIE(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), getOrCreateNameSpace(), and getOrCreateStaticMemberDIE().
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().
void DwarfUnit::addSourceLine | ( | DIE & | Die, |
DIGlobalVariable | G | ||
) |
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 | ||
) |
addUInt - Add an unsigned integer attribute data and value.
Definition at line 175 of file DwarfUnit.cpp.
References llvm::DIE::addValue(), llvm::DIEInteger::BestForm(), DIEIntegerOne, and DIEValueAllocator.
Referenced by addAddress(), addBlockByrefAddress(), addComplexAddress(), addConstantFPValue(), addConstantValue(), addOpAddress(), addRegisterOffset(), addRegisterOpPiece(), addSectionOffset(), addSourceLine(), addUInt(), applySubprogramAttributes(), constructTypeDIE(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), and getOrCreateStaticMemberDIE().
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 | ||
) |
addVariableAddress - Add DW_AT_location attribute for a DbgVariable based on provided MachineLocation.
Definition at line 486 of file DwarfUnit.cpp.
References addAddress(), addBlockByrefAddress(), addComplexAddress(), llvm::dwarf::DW_AT_location, llvm::DbgVariable::getVariable(), llvm::DbgVariable::isBlockByrefVariable(), llvm::DIVariable::isIndirect(), and llvm::DbgVariable::variableHasComplexAddress().
void DwarfUnit::applySubprogramAttributes | ( | DISubprogram | SP, |
DIE & | SPDie | ||
) |
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::applySubprogramAttributesToDefinition | ( | DISubprogram | SP, |
DIE & | SPDie | ||
) |
Definition at line 1444 of file DwarfUnit.cpp.
References addGlobalName(), applySubprogramAttributes(), llvm::DISubprogram::getContext(), llvm::DISubprogram::getFunctionDeclaration(), and llvm::DISubprogram::getName().
void DwarfUnit::applyVariableAttributes | ( | const DbgVariable & | Var, |
DIE & | VariableDie | ||
) |
Definition at line 1557 of file DwarfUnit.cpp.
References addFlag(), addSourceLine(), addString(), addType(), llvm::dwarf::DW_AT_artificial, llvm::dwarf::DW_AT_name, llvm::StringRef::empty(), llvm::DbgVariable::getName(), llvm::DbgVariable::getType(), llvm::DbgVariable::getVariable(), and llvm::DbgVariable::isArtificial().
constructContainingTypeDIEs - Construct DIEs for types that contain vtables.
Definition at line 1816 of file DwarfUnit.cpp.
References addDIEEntry(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), llvm::WinEH::CE, ContainingTypeMap, llvm::dwarf::DW_AT_containing_type, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), and getDIE().
void DwarfUnit::constructSubprogramArguments | ( | DIE & | Buffer, |
DITypeArray | Args | ||
) |
constructSubprogramArguments - Construct function argument DIEs.
Definition at line 1172 of file DwarfUnit.cpp.
References addFlag(), addType(), createAndAddDIE(), llvm::dwarf::DW_AT_artificial, llvm::dwarf::DW_TAG_formal_parameter, llvm::dwarf::DW_TAG_unspecified_parameters, llvm::DITypedArray< T >::getElement(), llvm::DITypedArray< T >::getNumElements(), and N.
Referenced by applySubprogramAttributes(), and constructTypeDIE().
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().
DIE & DwarfUnit::createAndAddDIE | ( | unsigned | Tag, |
DIE & | Parent, | ||
DIDescriptor | N = DIDescriptor() |
||
) |
Create a DIE with the given Tag, add the DIE to its parent, and call insertDIE if MD is not null.
Definition at line 395 of file DwarfUnit.cpp.
References llvm::DIE::addChild(), llvm::dwarf::DW_TAG_arg_variable, llvm::dwarf::DW_TAG_auto_variable, llvm::DIE::getChildren(), and insertDIE().
Referenced by constructSubprogramArguments(), constructTypeDIE(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), createTypeDIE(), getOrCreateNameSpace(), getOrCreateStaticMemberDIE(), getOrCreateSubprogramDIE(), and getOrCreateTypeDIE().
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] |
Emit the header for this unit, not including the initial length field.
Reimplemented in llvm::DwarfTypeUnit.
Definition at line 2027 of file DwarfUnit.cpp.
References llvm::MCStreamer::AddComment(), Asm, DD, llvm::AsmPrinter::EmitInt16(), llvm::AsmPrinter::EmitInt32(), llvm::AsmPrinter::EmitInt8(), llvm::AsmPrinter::EmitSectionOffset(), llvm::AsmPrinter::getDataLayout(), llvm::DwarfDebug::getDwarfVersion(), llvm::DataLayout::getPointerSize(), and llvm::AsmPrinter::OutStreamer.
virtual DwarfCompileUnit& llvm::DwarfUnit::getCU | ( | ) | [pure virtual] |
Implemented in llvm::DwarfTypeUnit, and llvm::DwarfCompileUnit.
Referenced by getOrCreateTypeDIE().
DICompileUnit llvm::DwarfUnit::getCUNode | ( | ) | const [inline] |
Definition at line 208 of file DwarfUnit.h.
References CUNode.
Referenced by addGlobalName(), and llvm::DwarfCompileUnit::addRange().
unsigned llvm::DwarfUnit::getDebugInfoOffset | ( | ) | const [inline] |
Definition at line 213 of file DwarfUnit.h.
References DebugInfoOffset.
DIE * DwarfUnit::getDIE | ( | DIDescriptor | D | ) | const |
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().
DIELoc* llvm::DwarfUnit::getDIELoc | ( | ) | [inline] |
getDIELoc - Returns a fresh newly allocated DIELoc.
Definition at line 251 of file DwarfUnit.h.
References DIEValueAllocator.
Referenced by applySubprogramAttributes().
const StringMap<const DIE *>& llvm::DwarfUnit::getGlobalNames | ( | ) | const [inline] |
Definition at line 210 of file DwarfUnit.h.
References GlobalNames.
const StringMap<const DIE *>& llvm::DwarfUnit::getGlobalTypes | ( | ) | const [inline] |
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.
MCSymbol* llvm::DwarfUnit::getLabelBegin | ( | ) | const [inline] |
Definition at line 195 of file DwarfUnit.h.
References LabelBegin, and Section.
Referenced by getLocalLabelBegin().
MCSymbol* llvm::DwarfUnit::getLabelEnd | ( | ) | const [inline] |
Definition at line 200 of file DwarfUnit.h.
uint16_t llvm::DwarfUnit::getLanguage | ( | ) | const [inline] |
Definition at line 207 of file DwarfUnit.h.
References CUNode, and llvm::DICompileUnit::getLanguage().
Referenced by llvm::DwarfDebug::addDwarfTypeUnitType(), applySubprogramAttributes(), computeIndexValue(), constructTypeDIE(), and getParentContextString().
MCSymbol* llvm::DwarfUnit::getLocalLabelBegin | ( | ) | 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.
MCSymbol* llvm::DwarfUnit::getLocalSectionSym | ( | ) | const [inline] |
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.
DIE * DwarfUnit::getOrCreateContextDIE | ( | DIScope | Context | ) |
getOrCreateContextDIE - Get context owner's DIE.
Definition at line 956 of file DwarfUnit.cpp.
References getDIE(), getOrCreateNameSpace(), getOrCreateSubprogramDIE(), getOrCreateTypeDIE(), getUnitDie(), llvm::DIDescriptor::isFile(), llvm::DIDescriptor::isNameSpace(), llvm::DIDescriptor::isSubprogram(), and llvm::DIDescriptor::isType().
Referenced by llvm::DwarfCompileUnit::createGlobalVariableDIE(), createTypeDIE(), getOrCreateNameSpace(), getOrCreateStaticMemberDIE(), getOrCreateSubprogramDIE(), and getOrCreateTypeDIE().
getOrCreateNameSpace - Create a DIE for DINameSpace.
Definition at line 1395 of file DwarfUnit.cpp.
References llvm::DwarfDebug::addAccelNamespace(), addGlobalName(), addSourceLine(), addString(), createAndAddDIE(), DD, llvm::dwarf::DW_AT_name, llvm::dwarf::DW_TAG_namespace, llvm::StringRef::empty(), llvm::DINameSpace::getContext(), getDIE(), llvm::DINameSpace::getName(), and getOrCreateContextDIE().
Referenced by getOrCreateContextDIE().
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().
DIE * DwarfUnit::getOrCreateStaticMemberDIE | ( | DIDerivedType | DT | ) | [protected] |
getOrCreateStaticMemberDIE - Create new static data member DIE.
getOrCreateStaticMemberDIE - Create new DIE for C++ static member.
Definition at line 1984 of file DwarfUnit.cpp.
References addConstantFPValue(), addConstantValue(), addFlag(), addSourceLine(), addString(), addType(), addUInt(), createAndAddDIE(), llvm::dwarf::DW_ACCESS_private, llvm::dwarf::DW_ACCESS_protected, llvm::dwarf::DW_ACCESS_public, llvm::dwarf::DW_AT_accessibility, llvm::dwarf::DW_AT_declaration, llvm::dwarf::DW_AT_external, llvm::dwarf::DW_AT_name, llvm::dwarf::DW_FORM_data1, llvm::DIDerivedType::getConstant(), llvm::DIType::getContext(), getDIE(), llvm::DIType::getName(), getOrCreateContextDIE(), llvm::DIDescriptor::getTag(), llvm::DIE::getTag(), llvm::DIDerivedType::getTypeDerivedFrom(), llvm::DIType::isPrivate(), llvm::DIType::isProtected(), llvm::DIType::isPublic(), llvm::dwarf::isType(), and llvm::DIDerivedType::Verify().
Referenced by constructTypeDIE(), and llvm::DwarfCompileUnit::createGlobalVariableDIE().
getOrCreateSubprogramDIE - Create new DIE using SP.
Definition at line 1416 of file DwarfUnit.cpp.
References applySubprogramAttributes(), createAndAddDIE(), llvm::dwarf::DW_TAG_subprogram, llvm::DISubprogram::getContext(), getDIE(), llvm::DISubprogram::getFunctionDeclaration(), getOrCreateContextDIE(), getUnitDie(), and llvm::DISubprogram::isDefinition().
Referenced by constructTypeDIE(), and getOrCreateContextDIE().
DIE * DwarfUnit::getOrCreateTypeDIE | ( | const MDNode * | TyNode | ) |
getOrCreateTypeDIE - Find existing DIE or create new DIE for the given DIType.
Definition at line 986 of file DwarfUnit.cpp.
References llvm::DwarfDebug::addDwarfTypeUnitType(), constructTypeDIE(), createAndAddDIE(), DD, llvm::dwarf::DW_TAG_restrict_type, GenerateDwarfTypeUnits, llvm::DIType::getContext(), getCU(), getDIE(), llvm::DwarfDebug::getDwarfVersion(), llvm::DICompositeType::getIdentifier(), getOrCreateContextDIE(), llvm::DIScope::getRef(), llvm::DIDescriptor::getTag(), llvm::DIDescriptor::isBasicType(), llvm::DIDescriptor::isCompositeType(), llvm::DIDescriptor::isDerivedType(), llvm::DIType::isForwardDecl(), and llvm::DIDescriptor::isType().
Referenced by addType(), llvm::DwarfDebug::beginModule(), constructTypeDIE(), and getOrCreateContextDIE().
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().
const SmallVectorImpl<RangeSpanList>& llvm::DwarfUnit::getRangeLists | ( | ) | const [inline] |
getRangeLists - Get the vector of range lists.
Definition at line 227 of file DwarfUnit.h.
References CURangeLists.
SmallVectorImpl<RangeSpanList>& llvm::DwarfUnit::getRangeLists | ( | ) | [inline] |
Definition at line 230 of file DwarfUnit.h.
References CURangeLists.
const SmallVectorImpl<RangeSpan>& llvm::DwarfUnit::getRanges | ( | ) | const [inline] |
getRanges - Get the list of ranges for this unit.
Definition at line 220 of file DwarfUnit.h.
References CURanges.
SmallVectorImpl<RangeSpan>& llvm::DwarfUnit::getRanges | ( | ) | [inline] |
Definition at line 221 of file DwarfUnit.h.
References CURanges.
const MCSection* llvm::DwarfUnit::getSection | ( | ) | const [inline] |
Definition at line 169 of file DwarfUnit.h.
References Section.
MCSymbol* llvm::DwarfUnit::getSectionSym | ( | ) | const [inline] |
Definition at line 182 of file DwarfUnit.h.
References Section, and SectionSym.
Referenced by getLocalSectionSym().
DwarfUnit* llvm::DwarfUnit::getSkeleton | ( | ) | const [inline] |
Get the skeleton unit associated with this unit.
Definition at line 154 of file DwarfUnit.h.
References Skeleton.
unsigned llvm::DwarfUnit::getUniqueID | ( | ) | const [inline] |
Definition at line 206 of file DwarfUnit.h.
References UniqueID.
Referenced by llvm::DwarfDebug::beginFunction(), llvm::DwarfCompileUnit::getOrCreateSourceID(), initSection(), llvm::DwarfTypeUnit::initSection(), and llvm::DwarfCompileUnit::initStmtList().
DIE& llvm::DwarfUnit::getUnitDie | ( | ) | [inline] |
Definition at line 209 of file DwarfUnit.h.
References UnitDie.
Referenced by addDIEEntry(), llvm::DwarfCompileUnit::DwarfCompileUnit(), getOrCreateContextDIE(), and getOrCreateSubprogramDIE().
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.
AsmPrinter* llvm::DwarfUnit::Asm [protected] |
Asm - Target of Dwarf emission.
Definition at line 82 of file DwarfUnit.h.
Referenced by addBlock(), addConstantFPValue(), addConstantValue(), addLocalString(), addRegisterOffset(), addRegisterOpPiece(), addString(), applySubprogramAttributes(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), emitHeader(), llvm::DwarfTypeUnit::emitHeader(), llvm::DwarfCompileUnit::getOrCreateSourceID(), initSection(), llvm::DwarfTypeUnit::initSection(), and llvm::DwarfCompileUnit::initStmtList().
DenseMap<DIE *, const MDNode *> llvm::DwarfUnit::ContainingTypeMap [protected] |
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().
DICompileUnit llvm::DwarfUnit::CUNode [protected] |
Node - MDNode for the compile unit.
Definition at line 73 of file DwarfUnit.h.
Referenced by getCUNode(), and getLanguage().
SmallVector<RangeSpanList, 1> llvm::DwarfUnit::CURangeLists [protected] |
Definition at line 121 of file DwarfUnit.h.
Referenced by addRangeList(), and getRangeLists().
SmallVector<RangeSpan, 1> llvm::DwarfUnit::CURanges [protected] |
Definition at line 117 of file DwarfUnit.h.
Referenced by llvm::DwarfCompileUnit::addRange(), and getRanges().
DwarfDebug* llvm::DwarfUnit::DD [protected] |
Definition at line 85 of file DwarfUnit.h.
Referenced by addBlock(), addConstantValue(), addFlag(), llvm::DwarfCompileUnit::addLabelAddress(), llvm::DwarfCompileUnit::addLocalLabelAddress(), addLocalString(), addLocationList(), addOpAddress(), llvm::DwarfCompileUnit::addRange(), addSectionDelta(), addSectionLabel(), addSectionOffset(), addString(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), emitHeader(), getDIE(), getOrCreateNameSpace(), getOrCreateTypeDIE(), and insertDIE().
unsigned llvm::DwarfUnit::DebugInfoOffset [protected] |
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().
DIEInteger* llvm::DwarfUnit::DIEIntegerOne [protected] |
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().
BumpPtrAllocator llvm::DwarfUnit::DIEValueAllocator [protected] |
Definition at line 124 of file DwarfUnit.h.
Referenced by addAddress(), addBlockByrefAddress(), addComplexAddress(), addConstantFPValue(), addConstantValue(), addDIETypeSignature(), addExpr(), addLabel(), llvm::DwarfCompileUnit::addLabelAddress(), addLabelDelta(), llvm::DwarfCompileUnit::addLocalLabelAddress(), addLocalString(), addLocationList(), addSectionDelta(), addSInt(), addString(), addUInt(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), DwarfUnit(), and getDIELoc().
DwarfFile* llvm::DwarfUnit::DU [protected] |
Definition at line 86 of file DwarfUnit.h.
Referenced by addLocalString(), and addString().
StringMap<const DIE *> llvm::DwarfUnit::GlobalNames [protected] |
GlobalNames - A map of globally visible named entities for this unit.
Definition at line 100 of file DwarfUnit.h.
Referenced by addGlobalName(), and getGlobalNames().
StringMap<const DIE *> llvm::DwarfUnit::GlobalTypes [protected] |
GlobalTypes - A map of globally visible types for this unit.
Definition at line 103 of file DwarfUnit.h.
Referenced by getGlobalTypes().
DIE* llvm::DwarfUnit::IndexTyDie [protected] |
IndexTyDie - An anonymous type for index type. Owned by UnitDie.
Definition at line 89 of file DwarfUnit.h.
MCSymbol* llvm::DwarfUnit::LabelBegin [protected] |
The start of the unit within its section.
Definition at line 136 of file DwarfUnit.h.
Referenced by getLabelBegin(), initSection(), and llvm::DwarfTypeUnit::initSection().
MCSymbol* llvm::DwarfUnit::LabelEnd [protected] |
The end of the unit within its section.
Definition at line 139 of file DwarfUnit.h.
Referenced by getLabelEnd(), initSection(), and llvm::DwarfTypeUnit::initSection().
DenseMap<const MDNode *, DIEEntry *> llvm::DwarfUnit::MDNodeToDIEEntryMap [protected] |
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.
DenseMap<const MDNode *, DIE *> llvm::DwarfUnit::MDNodeToDieMap [protected] |
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().
const MCSection* llvm::DwarfUnit::Section [protected] |
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().
MCSymbol* llvm::DwarfUnit::SectionSym [protected] |
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().
DwarfUnit* llvm::DwarfUnit::Skeleton [protected] |
Skeleton unit associated with this unit.
Definition at line 142 of file DwarfUnit.h.
Referenced by llvm::DwarfCompileUnit::addLabelAddress(), getLocalLabelBegin(), getLocalSectionSym(), getSkeleton(), and setSkeleton().
unsigned llvm::DwarfUnit::UniqueID [protected] |
UniqueID - a numeric ID unique among all CUs in the module.
Definition at line 70 of file DwarfUnit.h.
Referenced by getUniqueID().
DIE llvm::DwarfUnit::UnitDie [protected] |
Unit debug information entry.
Definition at line 76 of file DwarfUnit.h.
Referenced by llvm::DwarfCompileUnit::applyStmtList(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), llvm::DwarfTypeUnit::DwarfTypeUnit(), getUnitDie(), hasContent(), and llvm::DwarfCompileUnit::initStmtList().