14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H 15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H 50 DIE::value_iterator StmtListValue;
91 DIE *constructVariableDIEImpl(
const DbgVariable &DV,
bool Abstract);
93 bool isDwoUnit()
const override;
97 return AbstractSPDies;
103 return AbstractVariables;
151 assert(Scope &&
"Invalid Scope encoding!");
152 if (!isa<DILocalScope>(Scope))
156 auto *LocalScope = cast<DILocalScope>(Scope)->getNonLexicalBlockFileScope();
157 ImportedEntities[LocalScope].push_back(IE);
195 DIE *&ObjectPointer);
200 bool *HasNonScopeChildren =
nullptr);
245 return MacroLabelBegin;
257 const DIScope *Context)
override;
293 return (Skeleton ? Skeleton :
this)->CURangeLists;
311 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H const StringMap< const DIE * > & getGlobalTypes() const
const SmallVectorImpl< RangeSpanList > & getRangeLists() const
getRangeLists - Get the vector of range lists.
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.
Compute iterated dominance frontiers using a linear time algorithm.
std::pair< const DILocalVariable *, const DILocation * > InlinedVariable
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.
Collects and handles dwarf debug information.
DbgValueHistoryMap::InlinedVariable InlinedVariable
Find abstract variable associated with Var.
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.
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support...
void attachRangesOrLowHighPC(DIE &D, SmallVector< RangeSpan, 2 > Ranges)
DIScope * getScope() const
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.
void setDWOId(uint64_t DwoId)
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)
DIE * constructVariableDIE(DbgVariable &DV, bool Abstract=false)
constructVariableDIE - Construct a DIE for the given DbgVariable.
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 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.
void constructSubprogramScopeDIE(const DISubprogram *Sub, LexicalScope *Scope)
Construct a DIE for this subprogram scope.
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.
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.
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.
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.
DenseMap< const MDNode *, std::unique_ptr< DbgVariable > > & getAbstractVariables()
SmallVector< RangeSpan, 2 > takeRanges()
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope)
MCSymbol * getMacroLabelBegin() const
const StringMap< const DIE * > & getGlobalNames() const
Represents base address of the CU.
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")
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
bool includeMinimalInlineScopes() const
DwarfCompileUnit * getSkeleton() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void finishVariableDefinition(const DbgVariable &Var)
void addLocalLabelAddress(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
addLocalLabelAddress - Add a dwarf label attribute data and value using DW_FORM_addr only...
DbgVariable * getExistingAbstractVariable(InlinedVariable IV, const DILocalVariable *&Cleansed)
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
void createAbstractVariable(const DILocalVariable *Var, LexicalScope *Scope)
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...