14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
37 DIE::value_iterator StmtListValue;
76 DIE *constructVariableDIEImpl(
const DbgVariable &DV,
bool Abstract);
78 bool isDwoUnit()
const override;
82 return AbstractSPDies;
88 return AbstractVariables;
136 assert(Scope &&
"Invalid Scope encoding!");
137 if (!isa<DILocalScope>(Scope))
141 auto *LocalScope = cast<DILocalScope>(Scope)->getNonLexicalBlockFileScope();
142 ImportedEntities[LocalScope].push_back(IE);
179 DIE *&ObjectPointer);
184 unsigned *ChildScopeCount =
nullptr);
221 return MacroLabelBegin;
269 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...
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 finishVariableDefinition(const DbgVariable &Var)
void addScopeRangeList(DIE &ScopeDIE, SmallVector< RangeSpan, 2 > Range)
A helper function to construct a RangeSpanList for a given lexical scope.
void addGlobalName(StringRef Name, const DIE &Die, const DIScope *Context) override
Add a new global name to the compile unit.
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.
DenseMap< const MDNode *, DIE * > & getAbstractSPDies()
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.
bool shareAcrossDWOCUs() const
void addGlobalNameForTypeUnit(StringRef Name, const DIScope *Context)
Add a new global name present in a type unit to this compile unit.
void addGlobalTypeUnitType(const DIType *Ty, const DIScope *Context)
Add a new global type present in a type unit to this compile unit.
const DIExpression * Expr
DIScope * getScope() const
bool includeMinimalInlineScopes() 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.
DbgVariable * getExistingAbstractVariable(InlinedVariable IV, const DILocalVariable *&Cleansed)
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)
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.
DenseMap< const MDNode *, std::unique_ptr< DbgVariable > > & getAbstractVariables()
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.
void createAbstractVariable(const DILocalVariable *DV, LexicalScope *Scope)
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.
DbgValueHistoryMap::InlinedVariable InlinedVariable
Find abstract variable associated with Var.
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. ...
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 addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context) override
Add a new global type to the compile unit.
std::pair< const DILocalVariable *, const DILocation * > InlinedVariable
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
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.