14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
73 DIE *constructVariableDIEImpl(
const DbgVariable &DV,
bool Abstract);
75 bool isDwoUnit()
const override;
77 bool includeMinimalInlineScopes()
const;
125 assert(Scope &&
"Invalid Scope encoding!");
126 if (!isa<DILocalScope>(Scope))
130 auto *LocalScope = cast<DILocalScope>(Scope)->getNonLexicalBlockFileScope();
131 ImportedEntities[LocalScope].push_back(IE);
174 DIE *&ObjectPointer);
179 unsigned *ChildScopeCount =
nullptr);
209 return MacroLabelBegin;
250 return (Skeleton ? Skeleton :
this)->CURangeLists;
DIE * getOrCreateGlobalVariableDIE(const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
Get or create global variable DIE.
DIELoc - Represents an expression location.
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 attachLowHighPC(DIE &D, const MCSymbol *Begin, const MCSymbol *End)
Collects and handles dwarf debug information.
DwarfCompileUnit & getCU() override
LexicalScope - This class is used to track scope information.
MCSymbol * getMacroLabelBegin() const
DIE & updateSubprogramScopeDIE(const DISubprogram *SP)
Find DIE for the given subprogram and attach appropriate DW_AT_low_pc and DW_AT_high_pc attributes...
DIE * constructLexicalScopeDIE(LexicalScope *Scope)
Construct new DW_TAG_lexical_block for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels...
const StringMap< const DIE * > & getGlobalTypes() const
void applyVariableAttributes(const DbgVariable &Var, DIE &VariableDie)
DIE * createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
static GCRegistry::Add< StatepointGC > D("statepoint-example","an example strategy for statepoint")
Base class for the full range of assembler expressions which are needed for parsing.
void attachRangesOrLowHighPC(DIE &D, SmallVector< RangeSpan, 2 > Ranges)
DwarfCompileUnit * getSkeleton() const
void addScopeRangeList(DIE &ScopeDIE, SmallVector< RangeSpan, 2 > Range)
A helper function to construct a RangeSpanList for a given lexical scope.
void constructScopeDIE(LexicalScope *Scope, SmallVectorImpl< DIE * > &FinalChildren)
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...
void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr)
Add a Dwarf expression attribute data and value.
This class is used to track local variable information.
void setBaseAddress(const MCSymbol *Base)
void applySubprogramAttributesToDefinition(const DISubprogram *SP, DIE &SPDie)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
DwarfCompileUnit(unsigned UID, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
MCSymbol * getLabelBegin() const
void addAddress(DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
Add an address attribute to a die based on the location provided.
const DIExpression * Expr
DIScope * getScope() const
This dwarf writer support class manages information associated with a source file.
void applyStmtList(DIE &D)
Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
const SmallVectorImpl< RangeSpanList > & getRangeLists() const
getRangeLists - Get the vector of range lists.
A structured debug information entry.
const MCSymbol * getBaseAddress() const
This class is intended to be used as a driving class for all asm writers.
static const unsigned End
void addLocalLabelAddress(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
addLocalLabelAddress - Add a dwarf label attribute data and value using DW_FORM_addr only...
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope)
DIE::value_iterator addSectionLabel(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label, const MCSymbol *Sec)
addSectionLabel - Add a Dwarf section label attribute data and value.
A pair of GlobalVariable and DIExpression.
DIE * constructImportedEntityDIE(const DIImportedEntity *Module)
Construct import_module DIE.
DIE * constructVariableDIE(DbgVariable &DV, bool Abstract=false)
constructVariableDIE - Construct a DIE for the given DbgVariable.
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.
SmallVector< RangeSpan, 2 > takeRanges()
unsigned getOrCreateSourceID(StringRef FileName, StringRef DirName) override
Look up the source ID with the given directory and source file names.
DIE * constructInlinedScopeDIE(LexicalScope *Scope)
This scope represents inlined body of a function.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
const SmallVectorImpl< RangeSpan > & getRanges() const
getRanges - Get the list of ranges for this unit.
const StringMap< const DIE * > & getGlobalNames() const
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
void addRange(RangeSpan Range)
addRange - Add an address range to the list of ranges for this unit.
void addImportedEntity(const DIImportedEntity *IE)
void constructSubprogramScopeDIE(const DISubprogram *Sub, LexicalScope *Scope)
Construct a DIE for this subprogram scope.
void addVariableAddress(const DbgVariable &DV, DIE &Die, MachineLocation Location)
Add DW_AT_location attribute for a DbgVariable based on provided MachineLocation. ...
DIE::value_iterator addSectionDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
addSectionDelta - Add a label delta attribute data and value.
MCSection * getSection() const
Return the section that this DIEUnit will be emitted into.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::string DirName(const std::string &FileName)
void addGlobalName(StringRef Name, DIE &Die, const DIScope *Context) override
Add a new global name to the compile unit.
void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context) override
Add a new global type to the compile unit.
StringRef - Represent a constant reference to a string, i.e.
const GlobalVariable * Var
void addLocationList(DIE &Die, dwarf::Attribute Attribute, unsigned Index)
Add a Dwarf loclistptr attribute data and value.
unsigned getUniqueID() const
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
void finishSubprogramDefinition(const DISubprogram *SP)
void emitHeader(bool UseOffsets) override
Emit the 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...
DIE * createScopeChildrenDIE(LexicalScope *Scope, SmallVectorImpl< DIE * > &Children, unsigned *ChildScopeCount=nullptr)
A helper function to create children of a Scope DIE.