14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H 15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H 47 bool HasRangeLists =
false;
51 DIE::value_iterator StmtListValue;
78 const MCSymbol *BaseAddress =
nullptr;
88 DIE *constructVariableDIEImpl(
const DbgVariable &DV,
bool Abstract);
90 bool isDwoUnit()
const override;
94 return AbstractSPDies;
100 return AbstractEntities;
149 assert(Scope &&
"Invalid Scope encoding!");
150 if (!isa<DILocalScope>(Scope))
154 auto *LocalScope = cast<DILocalScope>(Scope)->getNonLexicalBlockFileScope();
155 ImportedEntities[LocalScope].push_back(IE);
193 DIE *&ObjectPointer);
201 bool *HasNonScopeChildren =
nullptr);
216 bool IsTail,
const MCExpr *PCOffset);
255 return MacroLabelBegin;
267 const DIScope *Context)
override;
321 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H const StringMap< const DIE * > & getGlobalTypes() const
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
const MCSymbol * getBaseAddress() const
DIELoc - Represents an expression location.
This class represents lattice values for constants.
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 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)
bool hasRangeLists() const
Collects and handles dwarf debug information.
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.
void attachLowHighPC(DIE &D, const MCSymbol *Begin, const MCSymbol *End)
DwarfCompileUnit & getCU() override
LexicalScope - This class is used to track scope information.
Tagged DWARF-like metadata node.
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support...
DbgEntity * getExistingAbstractEntity(const DINode *Node)
void attachRangesOrLowHighPC(DIE &D, SmallVector< RangeSpan, 2 > Ranges)
DIScope * getScope() const
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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...
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 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.
DbgValueHistoryMap::InlinedEntity InlinedEntity
Find abstract variable associated with Var.
void setDWOId(uint64_t DwoId)
void createAbstractEntity(const DINode *Node, LexicalScope *Scope)
DIE * constructInlinedScopeDIE(LexicalScope *Scope)
This scope represents inlined body of a function.
unsigned getUniqueID() const
uint64_t getDWOId() const
DenseMap< const MDNode *, DIE * > & getAbstractSPDies()
This class is used to track local variable information.
void setBaseAddress(const MCSymbol *Base)
void addAddrTableBase()
Add the DW_AT_addr_base attribute to the unit DIE.
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.
void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr)
Add a Dwarf expression attribute data and value.
const DIExpression * Expr
This class is used to track label information.
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.
A structured debug information entry.
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)
DwarfCompileUnit(unsigned UID, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
void addAddress(DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
Add an address attribute to a die based on the location provided.
DIE * createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE)
unsigned getHeaderSize() const override
Compute the size of a header for this unit, not including the initial length field.
DenseMap< const DINode *, std::unique_ptr< DbgEntity > > & getAbstractEntities()
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...
A pair of GlobalVariable and DIExpression.
bool hasDwarfPubSections() const
void addScopeRangeList(DIE &ScopeDIE, SmallVector< RangeSpan, 2 > Range)
A helper function to construct a RangeSpanList for a given lexical scope.
std::pair< const DINode *, const DILocation * > InlinedEntity
An imported module (C++ using directive or similar).
void setSkeleton(DwarfCompileUnit &Skel)
Set the skeleton unit associated with this unit.
Base class for scope-like contexts.
DIE * constructImportedEntityDIE(const DIImportedEntity *Module)
Construct import_module DIE.
DIE * constructLabelDIE(DbgLabel &DL, const LexicalScope &Scope)
Construct a DIE for the given DbgLabel.
SmallVector< RangeSpan, 2 > takeRanges()
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope)
MCSymbol * getMacroLabelBegin() const
const StringMap< const DIE * > & getGlobalNames() const
MCSection * getSection() const
Return the section that this DIEUnit will be emitted into.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void applySubprogramAttributesToDefinition(const DISubprogram *SP, DIE &SPDie)
void finishSubprogramDefinition(const DISubprogram *SP)
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
DIE & constructSubprogramScopeDIE(const DISubprogram *Sub, LexicalScope *Scope)
Construct a DIE for this subprogram scope.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
This file contains constants used for implementing Dwarf debug support.
const SmallVectorImpl< RangeSpan > & getRanges() const
getRanges - Get the list of ranges for this unit.
void addImportedEntity(const DIImportedEntity *IE)
DIE * getOrCreateGlobalVariableDIE(const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
Get or create global variable DIE.
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.
void applyVariableAttributes(const DbgVariable &Var, DIE &VariableDie)
bool shareAcrossDWOCUs() const
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
DwarfCompileUnit * getSkeleton() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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)
StringRef - Represent a constant reference to a string, i.e.
const GlobalVariable * Var
MCSymbol * getLabelBegin() const
void applyStmtList(DIE &D)
Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
DIE * constructLexicalScopeDIE(LexicalScope *Scope)
Construct new DW_TAG_lexical_block for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels...