58 :
DwarfUnit(dwarf::DW_TAG_compile_unit, Node, A, DW, DWU), UniqueID(UID) {
81 : dwarf::DW_FORM_GNU_addr_index,
132 DeclContext =
resolve(SDMDecl->getScope());
133 assert(SDMDecl->isStaticMember() &&
"Expected static member decl");
137 addDIEEntry(*VariableDIE, dwarf::DW_AT_specification, *VariableSpecDIE);
140 if (GTy !=
DD->
resolve(SDMDecl->getBaseType()))
150 addFlag(*VariableDIE, dwarf::DW_AT_external);
157 addFlag(*VariableDIE, dwarf::DW_AT_declaration);
162 addUInt(*VariableDIE, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata,
169 bool addToAccelTable =
false;
171 std::unique_ptr<DIEDwarfExpression> DwarfExpr;
172 for (
const auto &
GE : GlobalExprs) {
179 if (GlobalExprs.size() == 1 && Expr && Expr->
isConstant()) {
180 addToAccelTable =
true;
191 if (!Global && (!Expr || !Expr->
isConstant()))
199 addToAccelTable =
true;
201 DwarfExpr = llvm::make_unique<DIEDwarfExpression>(*
Asm, *
this, *Loc);
205 DwarfExpr->addFragmentOffset(Expr);
215 assert((PointerSize == 4 || PointerSize == 8) &&
216 "Add support for other sizes if necessary");
220 addUInt(*Loc, dwarf::DW_FORM_data1,
221 PointerSize == 4 ? dwarf::DW_OP_const4u
222 : dwarf::DW_OP_const8u);
225 addExpr(*Loc, dwarf::DW_FORM_udata,
228 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_const_index);
229 addUInt(*Loc, dwarf::DW_FORM_udata,
233 addUInt(*Loc, dwarf::DW_FORM_data1,
235 : dwarf::DW_OP_form_tls_address);
246 if (DwarfExpr->isUnknownLocation())
247 DwarfExpr->setMemoryLocationKind();
248 DwarfExpr->addExpression(Expr);
251 addBlock(*VariableDIE, dwarf::DW_AT_location, DwarfExpr->finalize());
256 if (addToAccelTable) {
276 if (CURanges.empty() || !SameAsPrevCU ||
277 (&CURanges.back().getEnd()->getSection() !=
279 CURanges.push_back(Range);
284 CURanges.back().setEnd(Range.
getEnd());
317 assert(Begin &&
"Begin label should not be null!");
318 assert(End &&
"End label should not be null!");
339 addFlag(*SPDie, dwarf::DW_AT_APPLE_omit_frame_ptr);
345 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_call_frame_cfa);
346 addBlock(*SPDie, dwarf::DW_AT_frame_base, Loc);
351 addAddress(*SPDie, dwarf::DW_AT_frame_base, Location);
371 "Only handle inlined subprograms here, use " 372 "constructSubprogramScopeDIE for non-inlined " 392 bool HasNonScopeChildren =
false;
400 if (!HasNonScopeChildren) {
401 FinalChildren.
insert(FinalChildren.
end(),
402 std::make_move_iterator(Children.begin()),
403 std::make_move_iterator(Children.end()));
407 assert(ScopeDIE &&
"Scope DIE should not be null.");
411 for (
auto &
I : Children)
414 FinalChildren.
push_back(std::move(ScopeDIE));
428 HasRangeLists =
true;
433 ->
addRange(*(Skeleton ? Skeleton :
this), std::move(Range));
436 auto &
List = *IndexAndList.second;
444 addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_rnglistx, Index);
445 else if (isDwoUnit())
481 DIE *OriginDIE = getAbstractSPDies()[InlinedSP];
482 assert(OriginDIE &&
"Unable to find original DIE for an inlined subprogram.");
485 addDIEEntry(*ScopeDIE, dwarf::DW_AT_abstract_origin, *OriginDIE);
493 addUInt(*ScopeDIE, dwarf::DW_AT_call_line,
None, IA->getLine());
495 addUInt(*ScopeDIE, dwarf::DW_AT_GNU_discriminator,
None,
496 IA->getDiscriminator());
522 auto D = constructVariableDIEImpl(DV, Abstract);
539 DIE *DwarfCompileUnit::constructVariableDIEImpl(
const DbgVariable &DV,
560 assert(DVInsn->getNumOperands() == 4);
561 if (DVInsn->getOperand(0).isReg()) {
562 auto RegOp = DVInsn->getOperand(0);
563 auto Op1 = DVInsn->getOperand(1);
565 assert((!Op1.isImm() || (Op1.getImm() == 0)) &&
"unexpected offset");
568 }
else if (DVInsn->getOperand(0).isImm()) {
572 if (Expr && Expr->getNumElements()) {
582 }
else if (DVInsn->getOperand(0).isFPImm())
584 else if (DVInsn->getOperand(0).isCImm())
598 unsigned FrameReg = 0;
623 DIE *&ObjectPointer) {
634 if (!Array || Array->getTag() != dwarf::DW_TAG_array_type)
636 for (
auto *El : Array->getElements()) {
637 if (
auto *Subrange = dyn_cast<DISubrange>(El)) {
638 auto Count = Subrange->getCount();
639 if (
auto *Dependency = Count.dyn_cast<
DIVariable *>())
660 for (
auto Var :
reverse(Input)) {
661 DbgVar.
insert({Var->getVariable(), Var});
666 while (!WorkList.
empty()) {
667 auto Item = WorkList.
back();
669 bool visitedAllDependencies = Item.getInt();
677 if (Visited.
count(Var))
681 if (visitedAllDependencies) {
688 auto Res = Visiting.
insert(Var);
690 assert(
false &&
"dependency cycle in local variables");
698 auto Dep = dyn_cast_or_null<const DILocalVariable>(Dependency);
707 bool *HasNonScopeChildren) {
709 DIE *ObjectPointer =
nullptr;
713 for (
auto &DV : Vars.Args)
729 if (HasNonScopeChildren)
730 *HasNonScopeChildren = !Children.
empty();
738 return ObjectPointer;
752 addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer);
761 if (FnArgs.
size() > 1 && !FnArgs[FnArgs.
size() - 1] &&
776 for (
auto &
I : Children)
779 return ObjectPointer;
799 else if (
auto *SPDecl =
SP->getDeclaration()) {
807 ContextCU =
DD->
lookupCU(ContextDIE->getUnitDie());
812 AbsDef = &ContextCU->
createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE,
nullptr);
818 ContextCU->
addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
832 assert(CalleeDIE &&
"Could not create DIE for call site entry origin");
833 addDIEEntry(CallSiteDIE, dwarf::DW_AT_call_origin, *CalleeDIE);
837 addFlag(CallSiteDIE, dwarf::DW_AT_call_tail_call);
841 assert(PCOffset &&
"Missing return PC information for a call");
842 addAddressExpr(CallSiteDIE, dwarf::DW_AT_call_return_pc, PCOffset);
853 if (
auto *NS = dyn_cast<DINamespace>(Entity))
855 else if (
auto *M = dyn_cast<DIModule>(Entity))
857 else if (
auto *
SP = dyn_cast<DISubprogram>(Entity))
859 else if (
auto *
T = dyn_cast<DIType>(Entity))
861 else if (
auto *GV = dyn_cast<DIGlobalVariable>(Entity))
864 EntityDie =
getDIE(Entity);
867 addDIEEntry(*IMDie, dwarf::DW_AT_import, *EntityDie);
870 addString(*IMDie, dwarf::DW_AT_name, Name);
877 if (
DIE *AbsSPDIE = getAbstractSPDies().
lookup(SP)) {
880 addDIEEntry(*D, dwarf::DW_AT_abstract_origin, *AbsSPDIE);
892 auto *Die = Entity->
getDIE();
896 if (AbsEntity && AbsEntity->
getDIE()) {
900 if (
const DbgVariable *Var = dyn_cast<const DbgVariable>(Entity))
902 else if ((Label = dyn_cast<const DbgLabel>(Entity)))
909 if (
const auto *Sym = Label->
getSymbol())
914 auto &AbstractEntities = getAbstractEntities();
915 auto I = AbstractEntities.find(Node);
916 if (
I != AbstractEntities.end())
917 return I->second.get();
924 auto &Entity = getAbstractEntities()[Node];
925 if (isa<const DILocalVariable>(Node)) {
926 Entity = llvm::make_unique<DbgVariable>(
927 cast<const DILocalVariable>(Node),
nullptr );;
929 }
else if (isa<const DILabel>(Node)) {
930 Entity = llvm::make_unique<DbgLabel>(
931 cast<const DILabel>(Node),
nullptr );
945 : dwarf::DW_UT_compile;
972 GlobalNames[FullName] = &Die;
984 GlobalNames.insert(std::make_pair(std::move(FullName), &
getUnitDie()));
993 GlobalTypes[FullName] = &Die;
1005 GlobalTypes.insert(std::make_pair(std::move(FullName), &
getUnitDie()));
1017 "block byref variable without a complex expression");
1021 addAddress(Die, dwarf::DW_AT_location, Location);
1070 : dwarf::DW_FORM_data4;
1078 addString(VariableDie, dwarf::DW_AT_name, Name);
1081 if (
uint32_t AlignInBytes = DIVar->getAlignInBytes())
1082 addUInt(VariableDie, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata,
1088 addFlag(VariableDie, dwarf::DW_AT_artificial);
1095 addString(LabelDie, dwarf::DW_AT_name, Name);
1114 auto *SPDecl = SP->getDeclaration();
1120 bool DwarfCompileUnit::isDwoUnit()
const {
1134 : dwarf::DW_AT_GNU_addr_base,
const DICompileUnit * getCUNode() const
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
void emitInt64(uint64_t Value) const
Emit a long long directive and value.
DIE::value_iterator addSectionDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
addSectionDelta - Add a label delta attribute data and value.
const DILocalScope * getScopeNode() const
bool isConstant() const
Determine whether this represents a standalone constant value.
void addFlag(DIE &Die, dwarf::Attribute Attribute)
Add a flag that is true to the DIE.
bool supportDebugThreadLocalLocation() const
Target supports TLS offset relocation in debug section?
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
bool isDefinition() const
unsigned getDebugLocListIndex() const
void addLabelDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
Add a label delta attribute data and value.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
DIELoc - Represents an expression location.
This class represents lattice values for constants.
bool isAbstractScope() const
MCSection * getDwarfLineSection() const
void addUnsignedConstant(uint64_t Value)
Emit an unsigned constant.
DIE * getOrCreateStaticMemberDIE(const DIDerivedType *DT)
Create new static data member DIE.
void addOpAddress(DIELoc &Die, const MCSymbol *Sym)
Add a dwarf op address data and value using the form given and an op of either DW_FORM_addr or DW_FOR...
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
void setMemoryLocationKind()
Lock this down to become a memory location description.
virtual int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const
getFrameIndexReference - This method should return the base register and offset used to reference a f...
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
void addGlobalName(StringRef Name, const DIE &Die, const DIScope *Context) override
Add a new global name to the compile unit.
void applyLabelAttributes(const DbgLabel &Label, DIE &LabelDie)
const DIType * getType() const
void push_back(const T &Elt)
void insertDIE(const DINode *Desc, DIE *D)
Insert DIE into the map.
Collects and handles dwarf debug information.
bool useGNUTLSOpcode() const
Returns whether to use DW_OP_GNU_push_tls_address, instead of the standard DW_OP_form_tls_address opc...
MD5::MD5Result * getMD5AsBytes(const DIFile *File) const
If the File has an MD5 checksum, return it as an MD5Result allocated in the MCContext.
SmallVectorImpl< InsnRange > & getRanges()
This class is defined as the common parent of DbgVariable and DbgLabel such that it could levarage po...
void addRange(RangeSpan Range)
addRange - Add an address range to the list of ranges for this unit.
bool hasDLLImportStorageClass() const
void attachLowHighPC(DIE &D, const MCSymbol *Begin, const MCSymbol *End)
unsigned const TargetRegisterInfo * TRI
MachineFunction * MF
The current machine function.
void reserve(size_type N)
Represents a pointer to a location list in the debug_loc section.
LexicalScope - This class is used to track scope information.
void addType(DIE &Entity, const DIType *Ty, dwarf::Attribute Attribute=dwarf::DW_AT_type)
Add a new type attribute to the specified entity.
DIE::value_iterator addSectionLabel(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label, const MCSymbol *Sec)
Add a Dwarf section label attribute data and value.
const MachineFunction * getCurrentFunction() const
StringRef getName() const
AsmPrinter * Asm
Target of Dwarf emission.
Tagged DWARF-like metadata node.
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support...
const MCSymbol * getSymbol() const
DIE * getDIE(const DINode *D) const
Returns the DIE map slot for the specified debug variable.
DbgEntity * getExistingAbstractEntity(const DINode *Node)
MCSection * getDwarfRnglistsSection() const
T * resolve(TypedDINodeRef< T > Ref) const
Look in the DwarfDebug map for the MDNode that corresponds to the reference.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
void attachRangesOrLowHighPC(DIE &D, SmallVector< RangeSpan, 2 > Ranges)
StringRef getName() const
amdgpu Simplify well known AMD library false Value Value const Twine & Name
void addArangeLabel(SymbolCU SCU)
Add a label so that arange data can be generated for it.
StringRef getName() const
bool isDebugDirectivesOnly() const
SmallVectorImpl< LexicalScope * > & getChildren()
void addComplexAddress(const DbgVariable &DV, DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
Start with the address based on the location provided, and generate the DWARF information necessary t...
LexicalScope * getParent() const
bool isObjectPointer() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Base class for the full range of assembler expressions which are needed for parsing.
void addSubprogramNames(const DICompileUnit &CU, const DISubprogram *SP, DIE &Die)
void addConstantFPValue(DIE &Die, const MachineOperand &MO)
Add constant value entry in variable DIE.
void emitHeader(bool UseOffsets) override
Emit the header for this unit, not including the initial length field.
void addGlobalTypeUnitType(const DIType *Ty, const DIScope *Context)
Add a new global type present in a type unit to this compile unit.
bool isLexicalScopeDIENull(LexicalScope *Scope)
A helper function to check whether the DIE for a given Scope is going to be null. ...
void addAccelName(const DICompileUnit &CU, StringRef Name, const DIE &Die)
DenseMap< LexicalScope *, ScopeVars > & getScopeVariables()
virtual unsigned getFrameRegister(const MachineFunction &MF) const =0
Debug information queries.
Holds a DIExpression and keeps track of how many operands have been consumed so far.
DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.
static const uint16_t * lookup(unsigned opcode, unsigned domain, ArrayRef< uint16_t[3]> Table)
StringRef getFilename() const
DIE * getOrCreateTypeDIE(const MDNode *TyNode)
Find existing DIE or create new DIE for the given type.
void addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Loc)
Add block data.
void createAbstractEntity(const DINode *Node, LexicalScope *Scope)
static Optional< DebugNameTableKind > getNameTableKind(StringRef Str)
void addString(DIE &Die, dwarf::Attribute Attribute, StringRef Str)
Add a string attribute data and value.
DIE * constructInlinedScopeDIE(LexicalScope *Scope)
This scope represents inlined body of a function.
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
AddressPool & getAddressPool()
bool isLocalToUnit() const
unsigned getUniqueID() const
const DIExpression * getSingleExpression() const
MCSymbol * getFunctionBegin() const
uint64_t getDWOId() const
This class is used to track local variable information.
bool DisableFramePointerElim(const MachineFunction &MF) const
DisableFramePointerElim - This returns true if frame pointer elimination optimization should be disab...
void addAddrTableBase()
Add the DW_AT_addr_base attribute to the unit DIE.
const DILocalVariable * getVariable() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
DIE * constructVariableDIE(DbgVariable &DV, bool Abstract=false)
constructVariableDIE - Construct a DIE for the given DbgVariable.
void addAddressExpr(DIE &Die, dwarf::Attribute Attribute, const MCExpr *Expr)
Add an attribute containing an address expression to Die.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
void addGlobalNameForTypeUnit(StringRef Name, const DIScope *Context)
Add a new global name present in a type unit to this compile unit.
const MachineInstr * getMInsn() const
DIE * getOrCreateNameSpace(const DINamespace *NS)
DIE & addChild(DIE *Child)
Add a child to the DIE.
DIScope * getScope() const
void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr)
Add a Dwarf expression attribute data and value.
const DwarfCompileUnit * getPrevCU() const
Returns the previous CU that was being updated.
bool hasComplexAddress() const
This class is used to track label information.
void addConstantValue(DIE &Die, const MachineOperand &MO, const DIType *Ty)
Add constant value entry in variable DIE.
bool useEmulatedTLS() const
Returns true if this target uses emulated TLS.
static DIE * get(BumpPtrAllocator &Alloc, dwarf::Tag Tag)
void applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie, bool SkipSPAttributes=false)
void addSourceLine(DIE &Die, unsigned Line, const DIFile *File)
Add location information to specified debug information entry.
This dwarf writer support class manages information associated with a source file.
void addLocationList(DIE &Die, dwarf::Attribute Attribute, unsigned Index)
Add a Dwarf loclistptr attribute data and value.
MCSection * getDwarfAddrSection() const
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const DILocation * getInlinedAt() const
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updat...
A structured debug information entry.
std::pair< iterator, bool > insert(const ValueT &V)
TargetMachine & TM
Target machine description.
This class is intended to be used as a driving class for all asm writers.
unsigned getOrCreateSourceID(const DIFile *File) override
Look up the source ID for the given file.
DIE * createScopeChildrenDIE(LexicalScope *Scope, SmallVectorImpl< DIE *> &Children, bool *HasNonScopeChildren=nullptr)
A helper function to create children of a Scope DIE.
void finishEntityDefinition(const DbgEntity *Entity)
MDTuple * getTemplateParams() const
DwarfCompileUnit(unsigned UID, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
DIDerivedType * getStaticDataMemberDeclaration() const
void emitCommonHeader(bool UseOffsets, dwarf::UnitType UT)
Emit the common part of the header for this unit.
void addAddress(DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
Add an address attribute to a die based on the location provided.
DIE * getOrCreateSubprogramDIE(const DISubprogram *SP, bool Minimal=false)
const Triple & getTargetTriple() const
bool hasFrameIndexExprs() const
Base class for variables.
DIE * createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE)
const DILabel * getLabel() const
Accessors.
bool addScopeVariable(LexicalScope *LS, DbgVariable *Var)
void addLabelAddress(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
addLabelAddress - Add a dwarf label attribute data and value using either DW_FORM_addr or DW_FORM_GNU...
dwarf::Tag getTag() const
T * resolve(TypedDINodeRef< T > Ref) const
Find the MDNode for the given reference.
Helper used to pair up a symbol and its DWARF compile unit.
StringRef getDirectory() const
bool useAllLinkageNames() const
Returns whether we should emit all DW_AT_[MIPS_]linkage_name.
MCSymbol * getLabelAfterInsn(const MachineInstr *MI)
Return Label immediately following the instruction.
bool hasDwarfPubSections() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
element_iterator elements_end() const
void addScopeRangeList(DIE &ScopeDIE, SmallVector< RangeSpan, 2 > Range)
A helper function to construct a RangeSpanList for a given lexical scope.
uint64_t getElement(unsigned I) const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const MCSymbol * getStart() const
ArrayRef< FrameIndexExpr > getFrameIndexExprs() const
Get the FI entries, sorted by fragment offset.
An imported module (C++ using directive or similar).
Base class for scope-like contexts.
DIE * constructImportedEntityDIE(const DIImportedEntity *Module)
Construct import_module DIE.
std::string getParentContextString(const DIScope *Context) const
Get string containing language specific context for a global name.
UnitType
Constants for unit types in DWARF v5.
void addSectionLabel(const MCSymbol *Sym)
void addExpression(DIExpressionCursor &&Expr, unsigned FragmentOffsetInBits=0)
Emit all remaining operations in the DIExpressionCursor.
DIE * constructLabelDIE(DbgLabel &DL, const LexicalScope &Scope)
Construct a DIE for the given DbgLabel.
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope)
void addScopeLabel(LexicalScope *LS, DbgLabel *Label)
bool useSectionsAsReferences() const
Returns whether to use sections as labels rather than temp symbols.
DenseMap< LexicalScope *, LabelList > & getScopeLabels()
StringRef getName() const
void setPrevCU(const DwarfCompileUnit *PrevCU)
static Optional< DebugEmissionKind > getEmissionKind(StringRef Str)
StringRef getName() const
MCSymbol * getSymbol(const GlobalValue *GV) const
DwarfCompileUnit * lookupCU(const DIE *Die)
Find the matching DwarfCompileUnit for the given CU DIE.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Information about stack frame layout on the target.
void addLinkageName(DIE &Die, StringRef LinkageName)
Add a linkage name, if it isn't empty.
void applySubprogramAttributesToDefinition(const DISubprogram *SP, DIE &SPDie)
MCSymbol * getBeginSymbol()
void finishSubprogramDefinition(const DISubprogram *SP)
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
bool useAppleExtensionAttributes() const
MCSymbol * getFunctionEnd() const
static SmallVector< const DIVariable *, 2 > dependencies(DbgVariable *Var)
Return all DIVariables that appear in count: expressions.
StringRef getDisplayName() const
void addTemplateParams(DIE &Buffer, DINodeArray TParams)
Add template parameters in buffer.
Implements a dense probed hash-table based set with some number of buckets stored inline...
StringRef getLinkageName() const
DIE & constructSubprogramScopeDIE(const DISubprogram *Sub, LexicalScope *Scope)
Construct a DIE for this subprogram scope.
This file contains constants used for implementing Dwarf debug support.
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
StringRef getName() const
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
virtual const MCSymbol * getFunctionFrameSymbol() const
Return symbol for the function pseudo stack if the stack frame is not a register based.
void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry)
Add a DIE attribute data and value.
iterator insert(iterator I, T &&Elt)
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
DIE * getOrCreateContextDIE(const DIScope *Context)
Get context owner's DIE.
dwarf::Tag getTag() const
Translate tag to proper Dwarf tag.
Representation of each machine instruction.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
DIE * getOrCreateGlobalVariableDIE(const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
Get or create global variable DIE.
DIE & createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N=nullptr)
Create a DIE with the given Tag, add the DIE to its parent, and call insertDIE if MD is not null...
LLVM_NODISCARD bool empty() const
bool useRangesSection() const
Returns whether ranges section should be emitted.
bool isBlockByrefVariable() const
void addVariableAddress(const DbgVariable &DV, DIE &Die, MachineLocation Location)
Add DW_AT_location attribute for a DbgVariable based on provided MachineLocation. ...
void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context) override
Add a new global type to the compile unit.
virtual const TargetFrameLowering * getFrameLowering() const
void applyVariableAttributes(const DbgVariable &Var, DIE &VariableDie)
Optional< StringRef > getSource() const
element_iterator elements_begin() const
DIE * getOrCreateModule(const DIModule *M)
static SmallVector< DbgVariable *, 8 > sortLocalVars(SmallVectorImpl< DbgVariable *> &Input)
Sort local variables so that variables appearing inside of helper expressions come first...
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
DIE & constructCallSiteEntryDIE(DIE &ScopeDIE, const DISubprogram &CalleeSP, bool IsTail, const MCExpr *PCOffset)
Construct a call site entry DIE describing a call within Scope to a callee described by CalleeSP...
bool includeMinimalInlineScopes() const
size_type count(const_arg_type_t< ValueT > V) const
Return 1 if the specified key is in the set, 0 otherwise.
const DICompileUnit * CUNode
MDNode for the compile unit.
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
DwarfExpression implementation for singular DW_AT_location.
uint16_t getDwarfVersion() const
void addFragmentOffset(const DIExpression *Expr)
If applicable, emit an empty DW_OP_piece / DW_OP_bit_piece to advance to the fragment described by Ex...
DITypeRef getType() const
MCSymbol * getLabelBeforeInsn(const MachineInstr *MI)
Return Label preceding the instruction.
BumpPtrAllocator DIEValueAllocator
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const MCSymbol * getEnd() const
uint32_t getAlignInBytes() const
DINodeRef getEntity() const
void addLocalLabelAddress(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
addLocalLabelAddress - Add a dwarf label attribute data and value using DW_FORM_addr only...
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
DIE & updateSubprogramScopeDIE(const DISubprogram *SP)
Find DIE for the given subprogram and attach appropriate DW_AT_low_pc and DW_AT_high_pc attributes...
void constructScopeDIE(LexicalScope *Scope, SmallVectorImpl< DIE *> &FinalChildren)
void addUInt(DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, uint64_t Integer)
Add an unsigned integer attribute data and value.
const DataLayout & getDataLayout() const
Return information about data layout.
bool isThreadLocal() const
If the value is "Thread Local", its value isn't shared by the threads.
const DINode * getEntity() const
Accessors.
bool isNVPTX() const
Tests whether the target is NVPTX (32- or 64-bit).
StringRef - Represent a constant reference to a string, i.e.
MCSection * getDwarfRangesSection() const
virtual const MCExpr * getDebugThreadLocalSymbol(const MCSymbol *Sym) const
Create a symbol reference to describe the given TLS variable when emitting the address in debug info...
void applyStmtList(DIE &D)
Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
MCSymbol * createTempSymbol(const Twine &Name) const
bool addMachineRegExpression(const TargetRegisterInfo &TRI, DIExpressionCursor &Expr, unsigned MachineReg, unsigned FragmentOffsetInBits=0)
Emit a machine register location.
bool isArtificial() const
Return true if DbgVariable is artificial.
value_iterator addValue(BumpPtrAllocator &Alloc, const DIEValue &V)
std::pair< const MachineInstr *, const MachineInstr * > InsnRange
InsnRange - This is used to track range of instructions with identical lexical scope.
DIE * constructLexicalScopeDIE(LexicalScope *Scope)
Construct new DW_TAG_lexical_block for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels...
DIScopeRef getScope() const
unsigned getIndex(const MCSymbol *Sym, bool TLS=false)
Returns the index into the address pool with the given label/symbol.