LLVM API Documentation
#include <DwarfCompileUnit.h>
Public Member Functions | |
CompileUnit (unsigned UID, DIE *D, DICompileUnit CU, AsmPrinter *A, DwarfDebug *DW, DwarfUnits *DWU) | |
CompileUnit - Compile unit constructor. More... | |
~CompileUnit () | |
~CompileUnit - Destructor for compile unit. More... | |
unsigned | getUniqueID () const |
uint16_t | getLanguage () const |
DICompileUnit | getNode () const |
DIE * | getCUDie () const |
const StringMap< DIE * > & | getGlobalNames () const |
const StringMap< DIE * > & | getGlobalTypes () const |
const StringMap< std::vector < DIE * > > & | getAccelNames () const |
const StringMap< std::vector < DIE * > > & | getAccelObjC () const |
const StringMap< std::vector < DIE * > > & | getAccelNamespace () const |
const StringMap< std::vector < std::pair< DIE *, unsigned > > > & | getAccelTypes () const |
unsigned | getDebugInfoOffset () const |
void | setDebugInfoOffset (unsigned DbgInfoOff) |
bool | hasContent () const |
std::string | getParentContextString (DIScope Context) const |
void | addGlobalName (StringRef Name, DIE *Die, DIScope Context) |
addGlobalName - Add a new global name to the compile unit. More... | |
void | addGlobalType (DIType Ty) |
void | addPubTypes (DISubprogram SP) |
addPubTypes - Add a set of types from the subprogram to the global types. More... | |
void | addAccelName (StringRef Name, DIE *Die) |
addAccelName - Add a new name to the name accelerator table. More... | |
void | addAccelObjC (StringRef Name, DIE *Die) |
addAccelObjC - Add a new name to the ObjC accelerator table. More... | |
void | addAccelNamespace (StringRef Name, DIE *Die) |
addAccelNamespace - Add a new name to the namespace accelerator table. More... | |
void | addAccelType (StringRef Name, std::pair< DIE *, unsigned > Die) |
addAccelType - Add a new type to the type accelerator table. More... | |
DIE * | getDIE (DIDescriptor D) const |
DIEBlock * | getDIEBlock () |
void | insertDIE (DIDescriptor Desc, DIE *D) |
void | addDie (DIE *Buffer) |
void | addFlag (DIE *Die, dwarf::Attribute Attribute) |
addFlag - Add a flag that is true to the DIE. More... | |
void | addUInt (DIE *Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, uint64_t Integer) |
void | addUInt (DIEBlock *Block, dwarf::Form Form, uint64_t Integer) |
void | addSInt (DIE *Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, int64_t Integer) |
void | addSInt (DIEBlock *Die, Optional< dwarf::Form > Form, int64_t Integer) |
void | addString (DIE *Die, dwarf::Attribute Attribute, const StringRef Str) |
void | addLocalString (DIE *Die, dwarf::Attribute Attribute, const StringRef Str) |
void | addExpr (DIEBlock *Die, dwarf::Form Form, const MCExpr *Expr) |
void | addLabel (DIE *Die, dwarf::Attribute Attribute, dwarf::Form Form, const MCSymbol *Label) |
void | addLabel (DIEBlock *Die, dwarf::Form Form, const MCSymbol *Label) |
void | addLabelAddress (DIE *Die, dwarf::Attribute Attribute, MCSymbol *Label) |
void | addOpAddress (DIEBlock *Die, const MCSymbol *Label) |
void | addDelta (DIE *Die, dwarf::Attribute Attribute, dwarf::Form Form, const MCSymbol *Hi, const MCSymbol *Lo) |
void | addDIEEntry (DIE *Die, dwarf::Attribute Attribute, DIE *Entry) |
void | addDIEEntry (DIE *Die, dwarf::Attribute Attribute, DIEEntry *Entry) |
void | addBlock (DIE *Die, dwarf::Attribute Attribute, DIEBlock *Block) |
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. More... | |
void | addConstantValue (DIE *Die, const ConstantInt *CI, bool Unsigned) |
addConstantValue - Add constant value entry in variable DIE. More... | |
void | addConstantValue (DIE *Die, const APInt &Val, bool Unsigned) |
void | addConstantFPValue (DIE *Die, const MachineOperand &MO) |
addConstantFPValue - Add constant value entry in variable DIE. More... | |
void | addConstantFPValue (DIE *Die, const ConstantFP *CFP) |
addConstantFPValue - Add constant value entry in variable DIE. More... | |
void | addTemplateParams (DIE &Buffer, DIArray TParams) |
addTemplateParams - Add template parameters in buffer. More... | |
void | addRegisterOp (DIEBlock *TheDie, unsigned Reg) |
addRegisterOp - Add register operand. More... | |
void | addRegisterOffset (DIEBlock *TheDie, unsigned Reg, int64_t Offset) |
addRegisterOffset - Add register offset. More... | |
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. More... | |
DIE * | getOrCreateNameSpace (DINameSpace NS) |
getOrCreateNameSpace - Create a DIE for DINameSpace. More... | |
DIE * | getOrCreateSubprogramDIE (DISubprogram SP) |
getOrCreateSubprogramDIE - Create new DIE using SP. More... | |
DIE * | getOrCreateTypeDIE (const MDNode *N) |
DIE * | getOrCreateContextDIE (DIScope Context) |
getOrCreateContextDIE - Get context owner's DIE. More... | |
void | createGlobalVariableDIE (DIGlobalVariable GV) |
createGlobalVariableDIE - create global variable DIE. More... | |
void | constructContainingTypeDIEs () |
DIE * | constructVariableDIE (DbgVariable &DV, bool isScopeAbstract) |
constructVariableDIE - Construct a DIE for the given DbgVariable. More... | |
DIE * | createAndAddDIE (unsigned Tag, DIE &Parent, DIDescriptor N=DIDescriptor()) |
unsigned | getHeaderSize () const |
void | emitHeader (const MCSection *ASection, const MCSymbol *ASectionSym) |
Emit the header for this unit, not including the initial length field. More... | |
CompileUnit - This dwarf writer support class manages information associated with a source file.
Definition at line 37 of file DwarfCompileUnit.h.
CompileUnit::CompileUnit | ( | unsigned | UID, |
DIE * | D, | ||
DICompileUnit | CU, | ||
AsmPrinter * | A, | ||
DwarfDebug * | DW, | ||
DwarfUnits * | DWU | ||
) |
CompileUnit - Compile unit constructor.
Definition at line 36 of file DwarfCompileUnit.cpp.
References insertDIE().
CompileUnit::~CompileUnit | ( | ) |
~CompileUnit - Destructor for compile unit.
Definition at line 45 of file DwarfCompileUnit.cpp.
addAccelName - Add a new name to the name accelerator table.
Definition at line 950 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnits::getStringPoolEntry().
Referenced by addSubprogramNames(), and createGlobalVariableDIE().
addAccelNamespace - Add a new name to the namespace accelerator table.
Definition at line 962 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnits::getStringPoolEntry().
Referenced by getOrCreateNameSpace().
addAccelObjC - Add a new name to the ObjC accelerator table.
Definition at line 956 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnits::getStringPoolEntry().
Referenced by addSubprogramNames().
addAccelType - Add a new type to the type accelerator table.
Definition at line 968 of file DwarfCompileUnit.cpp.
References llvm::DwarfUnits::getStringPoolEntry().
Referenced by getOrCreateTypeDIE().
void CompileUnit::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 469 of file DwarfCompileUnit.cpp.
References addBlock(), addRegisterOffset(), addRegisterOp(), addUInt(), llvm::dwarf::DW_OP_deref, llvm::MachineLocation::getOffset(), llvm::MachineLocation::getReg(), and llvm::MachineLocation::isReg().
Referenced by addVariableAddress().
addBlock - Add block data.
Definition at line 309 of file DwarfCompileUnit.cpp.
References llvm::DIE::addValue(), llvm::DIEBlock::BestForm(), and llvm::DIEBlock::ComputeSize().
Referenced by addAddress(), addBlockByrefAddress(), addComplexAddress(), addConstantFPValue(), addConstantValue(), createGlobalVariableDIE(), and getOrCreateSubprogramDIE().
void CompileUnit::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 584 of file DwarfCompileUnit.cpp.
References addBlock(), addRegisterOffset(), addRegisterOp(), addUInt(), llvm::dwarf::DW_OP_deref, llvm::dwarf::DW_OP_plus_uconst, llvm::DIArray::getElement(), llvm::DbgVariable::getName(), llvm::DIArray::getNumElements(), llvm::MachineLocation::getOffset(), llvm::DIType::getOffsetInBits(), llvm::MachineLocation::getReg(), llvm::DIDescriptor::getTag(), llvm::DbgVariable::getType(), llvm::DICompositeType::getTypeArray(), llvm::DIDerivedType::getTypeDerivedFrom(), llvm::MachineLocation::isReg(), and N.
Referenced by addVariableAddress().
void CompileUnit::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 DIVariable, starting from the starting location. Add the DWARF information to the die.
Definition at line 491 of file DwarfCompileUnit.cpp.
References addBlock(), addRegisterOffset(), addRegisterOp(), addUInt(), llvm::dwarf::DW_OP_deref, llvm::dwarf::DW_OP_plus_uconst, llvm::DbgVariable::getAddrElement(), llvm::DbgVariable::getNumAddrElements(), llvm::MachineLocation::getOffset(), llvm::MachineLocation::getReg(), llvm::MachineLocation::isReg(), llvm_unreachable, N, llvm::DIBuilder::OpDeref, and llvm::DIBuilder::OpPlus.
Referenced by addVariableAddress().
void CompileUnit::addConstantFPValue | ( | DIE * | Die, |
const MachineOperand & | MO | ||
) |
addConstantFPValue - Add constant value entry in variable DIE.
Definition at line 758 of file DwarfCompileUnit.cpp.
References addBlock(), addUInt(), llvm::APFloat::bitcastToAPInt(), llvm::APInt::getBitWidth(), llvm::AsmPrinter::getDataLayout(), llvm::MachineOperand::getFPImm(), llvm::APInt::getRawData(), llvm::ConstantFP::getValueAPF(), llvm::MachineOperand::isFPImm(), and llvm::DataLayout::isLittleEndian().
Referenced by constructVariableDIE().
void CompileUnit::addConstantFPValue | ( | DIE * | Die, |
const ConstantFP * | CFP | ||
) |
addConstantFPValue - Add constant value entry in variable DIE.
Definition at line 781 of file DwarfCompileUnit.cpp.
References addConstantValue(), llvm::APFloat::bitcastToAPInt(), and llvm::ConstantFP::getValueAPF().
void CompileUnit::addConstantValue | ( | DIE * | Die, |
const MachineOperand & | MO, | ||
DIType | Ty | ||
) |
addConstantValue - Add constant value entry in variable DIE.
Definition at line 719 of file DwarfCompileUnit.cpp.
References addSInt(), addUInt(), llvm::MachineOperand::getImm(), llvm::MachineOperand::isImm(), and isTypeSigned().
Referenced by addConstantFPValue(), addConstantValue(), constructVariableDIE(), and createGlobalVariableDIE().
void CompileUnit::addConstantValue | ( | DIE * | Die, |
const ConstantInt * | CI, | ||
bool | Unsigned | ||
) |
addConstantValue - Add constant value entry in variable DIE.
Definition at line 787 of file DwarfCompileUnit.cpp.
References addConstantValue(), llvm::ConstantInt::getValue(), and llvm::NVPTX::PTXLdStInstCode::Unsigned.
Definition at line 793 of file DwarfCompileUnit.cpp.
References addBlock(), addSInt(), addUInt(), llvm::APInt::getBitWidth(), llvm::AsmPrinter::getDataLayout(), llvm::APInt::getRawData(), llvm::APInt::getSExtValue(), llvm::APInt::getZExtValue(), and llvm::DataLayout::isLittleEndian().
void CompileUnit::addDelta | ( | DIE * | Die, |
dwarf::Attribute | Attribute, | ||
dwarf::Form | Form, | ||
const MCSymbol * | Hi, | ||
const MCSymbol * | Lo | ||
) |
addDelta - Add a label delta attribute data and value.
Definition at line 269 of file DwarfCompileUnit.cpp.
References llvm::DIE::addValue().
|
inline |
addDie - Adds or interns the DIE to the compile unit.
Definition at line 174 of file DwarfCompileUnit.h.
addDIEEntry - Add a DIE attribute data and value.
Definition at line 278 of file DwarfCompileUnit.cpp.
Referenced by addType(), constructContainingTypeDIEs(), constructVariableDIE(), createGlobalVariableDIE(), and getOrCreateSubprogramDIE().
addDIEEntry - Add a DIE attribute data and value.
Definition at line 283 of file DwarfCompileUnit.cpp.
References llvm::DIE::addValue(), llvm::DIE::getCompileUnitOrNull(), getCUDie(), and llvm::DIEEntry::getEntry().
addExpr - Add a Dwarf expression attribute data and value.
Definition at line 212 of file DwarfCompileUnit.cpp.
References llvm::DIE::addValue().
Referenced by createGlobalVariableDIE().
void CompileUnit::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 131 of file DwarfCompileUnit.cpp.
References llvm::DIE::addValue(), and llvm::DwarfDebug::getDwarfVersion().
Referenced by constructVariableDIE(), createGlobalVariableDIE(), llvm::DwarfDebug::endFunction(), and getOrCreateSubprogramDIE().
addGlobalName - Add a new global name to the compile unit.
addGlobalName - Add a new global entity to the compile unit.
Definition at line 975 of file DwarfCompileUnit.cpp.
References getParentContextString(), and llvm::StringRef::str().
Referenced by createGlobalVariableDIE(), and getOrCreateNameSpace().
void CompileUnit::addGlobalType | ( | DIType | Ty | ) |
addGlobalType - Add a new global type to the compile unit.
Definition at line 982 of file DwarfCompileUnit.cpp.
References llvm::StringRef::empty(), llvm::DIType::getContext(), llvm::DIType::getName(), getParentContextString(), llvm::DIDescriptor::isCompileUnit(), llvm::DIDescriptor::isFile(), llvm::DIType::isForwardDecl(), llvm::DIDescriptor::isNameSpace(), and llvm::StringRef::str().
Referenced by addPubTypes(), and addType().
void CompileUnit::addLabel | ( | DIE * | Die, |
dwarf::Attribute | Attribute, | ||
dwarf::Form | Form, | ||
const MCSymbol * | Label | ||
) |
addLabel - Add a Dwarf label attribute data and value.
Definition at line 219 of file DwarfCompileUnit.cpp.
References llvm::DIE::addValue().
Referenced by addLabel(), addOpAddress(), and constructVariableDIE().
Definition at line 225 of file DwarfCompileUnit.cpp.
References addLabel().
addLabelAddress - Add a dwarf label attribute data and value using either DW_FORM_addr or DW_FORM_GNU_addr_index.
addLabelAddress - Add a dwarf label attribute data and value using DW_FORM_addr or DW_FORM_GNU_addr_index.
Definition at line 233 of file DwarfCompileUnit.cpp.
References llvm::DwarfDebug::addArangeLabel(), llvm::DIE::addValue(), llvm::DwarfUnits::getAddrPoolIndex(), and llvm::DwarfDebug::useSplitDwarf().
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 197 of file DwarfCompileUnit.cpp.
References llvm::DIE::addValue(), llvm::DwarfUnits::getStringPoolEntry(), llvm::DwarfUnits::getStringPoolSym(), and llvm::AsmPrinter::needsRelocationsForDwarfStringPool().
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 256 of file DwarfCompileUnit.cpp.
References llvm::DwarfDebug::addArangeLabel(), addLabel(), addUInt(), llvm::dwarf::DW_OP_addr, llvm::dwarf::DW_OP_GNU_addr_index, llvm::DwarfUnits::getAddrPoolIndex(), and llvm::DwarfDebug::useSplitDwarf().
Referenced by createGlobalVariableDIE().
void CompileUnit::addPubTypes | ( | DISubprogram | SP | ) |
addPubTypes - Add a set of types from the subprogram to the global types.
addPubTypes - Add subprogram argument types for pubtypes section.
Definition at line 1035 of file DwarfCompileUnit.cpp.
References addGlobalType(), llvm::DIArray::getElement(), llvm::DIArray::getNumElements(), llvm::DIDescriptor::getTag(), llvm::DISubprogram::getType(), and llvm::DICompositeType::getTypeArray().
addRegisterOffset - Add register offset.
Definition at line 450 of file DwarfCompileUnit.cpp.
References addSInt(), addUInt(), llvm::dwarf::DW_OP_breg0, llvm::dwarf::DW_OP_bregx, llvm::dwarf::DW_OP_fbreg, llvm::MCRegisterInfo::getDwarfRegNum(), llvm::TargetRegisterInfo::getFrameRegister(), llvm::TargetMachine::getRegisterInfo(), llvm::AsmPrinter::MF, and llvm::AsmPrinter::TM.
Referenced by addAddress(), addBlockByrefAddress(), and addComplexAddress().
addRegisterOp - Add register operand.
Definition at line 438 of file DwarfCompileUnit.cpp.
References addUInt(), llvm::dwarf::DW_OP_reg0, llvm::dwarf::DW_OP_regx, llvm::MCRegisterInfo::getDwarfRegNum(), llvm::TargetMachine::getRegisterInfo(), and llvm::AsmPrinter::TM.
Referenced by addAddress(), addBlockByrefAddress(), and addComplexAddress().
void CompileUnit::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 155 of file DwarfCompileUnit.cpp.
References llvm::DIE::addValue(), and llvm::DIEInteger::BestForm().
Referenced by addConstantValue(), addRegisterOffset(), and addSInt().
Definition at line 163 of file DwarfCompileUnit.cpp.
References addSInt().
void CompileUnit::addSourceLine | ( | DIE * | Die, |
DIVariable | V | ||
) |
addSourceLine - Add location information to specified debug information entry.
Definition at line 318 of file DwarfCompileUnit.cpp.
References addUInt(), llvm::DIVariable::getContext(), llvm::DIScope::getDirectory(), llvm::DIScope::getFilename(), llvm::DIVariable::getLineNumber(), llvm::DwarfDebug::getOrCreateSourceID(), getUniqueID(), llvm::DIDescriptor::isVariable(), and llvm::None.
Referenced by constructVariableDIE(), createGlobalVariableDIE(), getOrCreateNameSpace(), and getOrCreateSubprogramDIE().
void CompileUnit::addSourceLine | ( | DIE * | Die, |
DIGlobalVariable | G | ||
) |
addSourceLine - Add location information to specified debug information entry.
Definition at line 336 of file DwarfCompileUnit.cpp.
References addUInt(), llvm::DIGlobalVariable::getDirectory(), llvm::DIGlobalVariable::getFilename(), llvm::DIGlobalVariable::getLineNumber(), llvm::DwarfDebug::getOrCreateSourceID(), getUniqueID(), llvm::DIDescriptor::isGlobalVariable(), and llvm::None.
void CompileUnit::addSourceLine | ( | DIE * | Die, |
DISubprogram | SP | ||
) |
addSourceLine - Add location information to specified debug information entry.
Definition at line 353 of file DwarfCompileUnit.cpp.
References addUInt(), llvm::DIScope::getDirectory(), llvm::DIScope::getFilename(), llvm::DISubprogram::getLineNumber(), llvm::DwarfDebug::getOrCreateSourceID(), getUniqueID(), llvm::DIDescriptor::isSubprogram(), and llvm::None.
addSourceLine - Add location information to specified debug information entry.
Definition at line 372 of file DwarfCompileUnit.cpp.
References addUInt(), llvm::DIScope::getDirectory(), llvm::DIScope::getFilename(), llvm::DIType::getLineNumber(), llvm::DwarfDebug::getOrCreateSourceID(), getUniqueID(), llvm::DIDescriptor::isType(), and llvm::None.
void CompileUnit::addSourceLine | ( | DIE * | Die, |
DINameSpace | NS | ||
) |
addSourceLine - Add location information to specified debug information entry.
Definition at line 407 of file DwarfCompileUnit.cpp.
References addUInt(), llvm::DIScope::getDirectory(), llvm::DIScope::getFilename(), llvm::DINameSpace::getLineNumber(), llvm::DwarfDebug::getOrCreateSourceID(), getUniqueID(), llvm::None, and llvm::DINameSpace::Verify().
void CompileUnit::addSourceLine | ( | DIE * | Die, |
DIObjCProperty | Ty | ||
) |
addSourceLine - Add location information to specified debug information entry.
Definition at line 389 of file DwarfCompileUnit.cpp.
References addUInt(), llvm::ARMBuildAttrs::File, llvm::DIScope::getDirectory(), llvm::DIObjCProperty::getFile(), llvm::DIScope::getFilename(), llvm::DIObjCProperty::getLineNumber(), llvm::DwarfDebug::getOrCreateSourceID(), getUniqueID(), llvm::DIDescriptor::isObjCProperty(), and llvm::None.
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 173 of file DwarfCompileUnit.cpp.
References llvm::DIE::addValue(), llvm::DwarfUnits::getStringPoolEntry(), llvm::DwarfUnits::getStringPoolIndex(), llvm::DwarfUnits::getStringPoolSym(), llvm::AsmPrinter::needsRelocationsForDwarfStringPool(), and llvm::DwarfDebug::useSplitDwarf().
Referenced by constructVariableDIE(), createGlobalVariableDIE(), getOrCreateNameSpace(), and getOrCreateSubprogramDIE().
addTemplateParams - Add template parameters in buffer.
addTemplateParams - Add template parameters into buffer.
Definition at line 849 of file DwarfCompileUnit.cpp.
References llvm::DIArray::getElement(), llvm::DIArray::getNumElements(), llvm::DIDescriptor::isTemplateTypeParameter(), and llvm::DIDescriptor::isTemplateValueParameter().
Referenced by getOrCreateSubprogramDIE().
void CompileUnit::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 922 of file DwarfCompileUnit.cpp.
References addDIEEntry(), addGlobalType(), and getOrCreateTypeDIE().
Referenced by constructVariableDIE(), createGlobalVariableDIE(), and getOrCreateSubprogramDIE().
void CompileUnit::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 140 of file DwarfCompileUnit.cpp.
References llvm::DIE::addValue(), and llvm::DIEInteger::BestForm().
Referenced by addAddress(), addBlockByrefAddress(), addComplexAddress(), addConstantFPValue(), addConstantValue(), addOpAddress(), addRegisterOffset(), addRegisterOp(), addSourceLine(), addUInt(), createGlobalVariableDIE(), and getOrCreateSubprogramDIE().
void CompileUnit::addUInt | ( | DIEBlock * | Block, |
dwarf::Form | Form, | ||
uint64_t | Integer | ||
) |
Definition at line 149 of file DwarfCompileUnit.cpp.
References addUInt().
void CompileUnit::addVariableAddress | ( | const DbgVariable & | DV, |
DIE * | Die, | ||
MachineLocation | Location | ||
) |
addVariableAddress - Add DW_AT_location attribute for a DbgVariable based on provided MachineLocation.
Definition at line 426 of file DwarfCompileUnit.cpp.
References addAddress(), addBlockByrefAddress(), addComplexAddress(), llvm::DbgVariable::getVariable(), llvm::DbgVariable::isBlockByrefVariable(), llvm::DIVariable::isIndirect(), and llvm::DbgVariable::variableHasComplexAddress().
Referenced by constructVariableDIE().
void CompileUnit::constructContainingTypeDIEs | ( | ) |
constructContainingTypeDIEs - Construct DIEs for types that contain vtables.
Definition at line 1727 of file DwarfCompileUnit.cpp.
References addDIEEntry(), and getDIE().
DIE * CompileUnit::constructVariableDIE | ( | DbgVariable & | DV, |
bool | isScopeAbstract | ||
) |
constructVariableDIE - Construct a DIE for the given DbgVariable.
Definition at line 1743 of file DwarfCompileUnit.cpp.
References addConstantFPValue(), addConstantValue(), addDIEEntry(), addFlag(), addLabel(), addSourceLine(), addString(), addType(), addVariableAddress(), llvm::StringRef::empty(), llvm::DbgVariable::getAbstractVariable(), llvm::DbgVariable::getDotDebugLocOffset(), llvm::DwarfDebug::getDwarfVersion(), llvm::DbgVariable::getFrameIndex(), llvm::TargetFrameLowering::getFrameIndexReference(), llvm::TargetMachine::getFrameLowering(), llvm::DbgVariable::getMInsn(), llvm::DbgVariable::getName(), llvm::MachineOperand::getReg(), llvm::DbgVariable::getTag(), llvm::AsmPrinter::GetTempSymbol(), llvm::DbgVariable::getType(), llvm::DbgVariable::getVariable(), llvm::DbgVariable::isArtificial(), isUnsignedDIType(), llvm::AsmPrinter::MF, llvm::DbgVariable::setDIE(), and llvm::AsmPrinter::TM.
DIE * CompileUnit::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 299 of file DwarfCompileUnit.cpp.
References llvm::DIE::addChild(), and insertDIE().
Referenced by createGlobalVariableDIE(), getOrCreateNameSpace(), getOrCreateSubprogramDIE(), and getOrCreateTypeDIE().
void CompileUnit::createGlobalVariableDIE | ( | DIGlobalVariable | GV | ) |
createGlobalVariableDIE - create global variable DIE.
Definition at line 1509 of file DwarfCompileUnit.cpp.
References addAccelName(), addBlock(), addConstantValue(), addDIEEntry(), addExpr(), addFlag(), addGlobalName(), addOpAddress(), addSourceLine(), addString(), addType(), addUInt(), createAndAddDIE(), llvm::dwarf::DW_OP_const4u, llvm::dwarf::DW_OP_const8u, llvm::dwarf::DW_OP_constu, llvm::dwarf::DW_OP_GNU_const_index, llvm::dwarf::DW_OP_GNU_push_tls_address, llvm::dwarf::DW_OP_plus, llvm::StringRef::empty(), llvm::DwarfUnits::getAddrPoolIndex(), llvm::DIGlobalVariable::getConstant(), llvm::DIGlobalVariable::getContext(), llvm::AsmPrinter::getDataLayout(), llvm::TargetLoweringObjectFile::getDebugThreadLocalSymbol(), getDIE(), llvm::DIGlobalVariable::getDisplayName(), llvm::DIGlobalVariable::getGlobal(), llvm::DataLayout::getIndexedOffset(), llvm::DIGlobalVariable::getLinkageName(), getMergedGlobalExpr(), llvm::DIGlobalVariable::getName(), llvm::AsmPrinter::getObjFileLowering(), getOrCreateContextDIE(), llvm::DataLayout::getPointerSize(), llvm::GlobalValue::getRealLinkageName(), llvm::DIGlobalVariable::getStaticDataMemberDeclaration(), llvm::AsmPrinter::getSymbol(), llvm::DIDescriptor::getTag(), llvm::Value::getType(), llvm::DIGlobalVariable::getType(), llvm::DIDescriptor::isCompileUnit(), llvm::DIGlobalVariable::isDefinition(), llvm::DIDescriptor::isFile(), llvm::DIDescriptor::isGlobalVariable(), llvm::DIGlobalVariable::isLocalToUnit(), llvm::DIType::isStaticMember(), llvm::DwarfDebug::isSubprogramContext(), llvm::GlobalVariable::isThreadLocal(), isUnsignedDIType(), llvm::DwarfDebug::useSplitDwarf(), and llvm::DIDerivedType::Verify().
Emit the header for this unit, not including the initial length field.
Definition at line 1947 of file DwarfCompileUnit.cpp.
References llvm::MCStreamer::AddComment(), llvm::AsmPrinter::EmitInt16(), llvm::AsmPrinter::EmitInt8(), llvm::AsmPrinter::EmitSectionOffset(), llvm::AsmPrinter::getDataLayout(), llvm::DwarfDebug::getDwarfVersion(), llvm::MCSection::getLabelBeginName(), llvm::DataLayout::getPointerSize(), llvm::AsmPrinter::GetTempSymbol(), and llvm::AsmPrinter::OutStreamer.
Referenced by llvm::DwarfUnits::emitUnits().
Definition at line 109 of file DwarfCompileUnit.h.
Definition at line 115 of file DwarfCompileUnit.h.
Definition at line 112 of file DwarfCompileUnit.h.
|
inline |
Definition at line 119 of file DwarfCompileUnit.h.
|
inline |
Definition at line 105 of file DwarfCompileUnit.h.
Referenced by addDIEEntry(), llvm::DwarfUnits::emitUnits(), and getOrCreateContextDIE().
|
inline |
Definition at line 123 of file DwarfCompileUnit.h.
Referenced by llvm::DwarfDebug::emitDIE().
DIE * CompileUnit::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 113 of file DwarfCompileUnit.cpp.
References llvm::DwarfDebug::getDIE(), and isShareableAcrossCUs().
Referenced by constructContainingTypeDIEs(), createGlobalVariableDIE(), getOrCreateContextDIE(), getOrCreateNameSpace(), getOrCreateSubprogramDIE(), and getOrCreateTypeDIE().
|
inline |
Definition at line 164 of file DwarfCompileUnit.h.
Referenced by getOrCreateSubprogramDIE().
Definition at line 106 of file DwarfCompileUnit.h.
Definition at line 107 of file DwarfCompileUnit.h.
|
inline |
Compute the size of a header for this unit, not including the initial length field.
Definition at line 328 of file DwarfCompileUnit.h.
Referenced by llvm::DwarfUnits::emitUnits().
|
inline |
Definition at line 103 of file DwarfCompileUnit.h.
References llvm::DICompileUnit::getLanguage().
Referenced by computeIndexValue(), getOrCreateSubprogramDIE(), getParentContextString(), and shouldAddODRHash().
|
inline |
Definition at line 104 of file DwarfCompileUnit.h.
getOrCreateContextDIE - Get context owner's DIE.
Definition at line 863 of file DwarfCompileUnit.cpp.
References getCUDie(), getDIE(), getOrCreateNameSpace(), getOrCreateSubprogramDIE(), getOrCreateTypeDIE(), llvm::DIDescriptor::isFile(), llvm::DIDescriptor::isNameSpace(), llvm::DIDescriptor::isSubprogram(), and llvm::DIDescriptor::isType().
Referenced by createGlobalVariableDIE(), getOrCreateNameSpace(), getOrCreateSubprogramDIE(), and getOrCreateTypeDIE().
DIE * CompileUnit::getOrCreateNameSpace | ( | DINameSpace | NS | ) |
getOrCreateNameSpace - Create a DIE for DINameSpace.
Definition at line 1355 of file DwarfCompileUnit.cpp.
References addAccelNamespace(), addGlobalName(), addSourceLine(), addString(), createAndAddDIE(), llvm::StringRef::empty(), llvm::DINameSpace::getContext(), getDIE(), llvm::DINameSpace::getName(), and getOrCreateContextDIE().
Referenced by getOrCreateContextDIE().
DIE * CompileUnit::getOrCreateSubprogramDIE | ( | DISubprogram | SP | ) |
getOrCreateSubprogramDIE - Create new DIE using SP.
Definition at line 1376 of file DwarfCompileUnit.cpp.
References addBlock(), addDIEEntry(), addFlag(), addSourceLine(), addString(), addTemplateParams(), addType(), addUInt(), createAndAddDIE(), llvm::dwarf::DW_LANG_C89, llvm::dwarf::DW_LANG_C99, llvm::dwarf::DW_LANG_ObjC, llvm::dwarf::DW_OP_constu, llvm::StringRef::empty(), llvm::DISubprogram::getContainingType(), llvm::DISubprogram::getContext(), getDIE(), getDIEBlock(), llvm::DISubprogram::getFunctionDeclaration(), llvm::AsmPrinter::getISAEncoding(), getLanguage(), llvm::DISubprogram::getLinkageName(), llvm::DISubprogram::getName(), getOrCreateContextDIE(), llvm::GlobalValue::getRealLinkageName(), llvm::DIDescriptor::getTag(), llvm::DISubprogram::getTemplateParams(), llvm::DISubprogram::getType(), llvm::DICompositeType::getTypeArray(), llvm::DISubprogram::getVirtualIndex(), llvm::DISubprogram::getVirtuality(), llvm::isa(), llvm::DISubprogram::isArtificial(), llvm::DISubprogram::isDefinition(), llvm::DISubprogram::isLocalToUnit(), llvm::DISubprogram::isOptimized(), llvm::DISubprogram::isPrototyped(), llvm::DIDescriptor::isSubprogram(), and N.
Referenced by getOrCreateContextDIE().
getOrCreateTypeDIE - Find existing DIE or create new DIE for the given DIType.
Definition at line 877 of file DwarfCompileUnit.cpp.
References addAccelType(), createAndAddDIE(), llvm::dwarf::DW_FLAG_type_implementation, llvm::StringRef::empty(), llvm::DIType::getContext(), getDIE(), llvm::DIType::getName(), getOrCreateContextDIE(), llvm::DICompositeType::getRunTimeLang(), llvm::DIDescriptor::getTag(), llvm::DIDescriptor::isBasicType(), llvm::DIDescriptor::isCompositeType(), llvm::DIDescriptor::isDerivedType(), llvm::DIType::isForwardDecl(), llvm::DIType::isObjcClassComplete(), and llvm::DIDescriptor::isType().
Referenced by addType(), and getOrCreateContextDIE().
std::string CompileUnit::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 999 of file DwarfCompileUnit.cpp.
References llvm::dwarf::DW_LANG_C_plus_plus, llvm::StringRef::empty(), llvm::DIScope::getContext(), getLanguage(), llvm::DIScope::getName(), I, llvm::DIDescriptor::isCompileUnit(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorTemplateCommon< T >::rbegin(), and llvm::SmallVectorTemplateCommon< T >::rend().
Referenced by addGlobalName(), and addGlobalType().
|
inline |
Definition at line 102 of file DwarfCompileUnit.h.
Referenced by addSourceLine(), llvm::DwarfDebug::beginFunction(), CUSort(), and llvm::DwarfUnits::emitUnits().
|
inline |
hasContent - Return true if this compile unit has something to write out.
Definition at line 128 of file DwarfCompileUnit.h.
void CompileUnit::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 122 of file DwarfCompileUnit.cpp.
References llvm::DwarfDebug::insertDIE(), and isShareableAcrossCUs().
Referenced by CompileUnit(), and createAndAddDIE().
|
inline |
Definition at line 124 of file DwarfCompileUnit.h.