14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
61 DIE *constructVariableDIEImpl(
const DbgVariable &DV,
bool Abstract);
63 bool isDwoUnit()
const override;
65 bool includeMinimalInlineScopes()
const;
141 DIE *&ObjectPointer);
146 unsigned *ChildScopeCount =
nullptr);
171 return sizeof(uint32_t) +
187 const DIScope *Context)
override;
220 return (Skeleton ? Skeleton :
this)->CURangeLists;
MCSection * Section
The section this unit will be emitted in.
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.
void collectDeadVariables(const DISubprogram *SP)
DwarfCompileUnit & getCU() override
LexicalScope - This class is used to track scope information.
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 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)
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.
DIE * getOrCreateGlobalVariableDIE(const DIGlobalVariable *GV)
getOrCreateGlobalVariableDIE - get or create global variable DIE.
const MCSymbol * getSectionSym() 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.
DIE - A structured debug information entry.
const MCSymbol * getBaseAddress() const
This class is intended to be used as a driving class for all asm writers.
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.
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.
void constructSubprogramScopeDIE(LexicalScope *Scope)
Construct a DIE for this subprogram 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.
MCSymbol * getBeginSymbol()
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 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.
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.
DIE & UnitDie
Unit debug information entry.
StringRef - Represent a constant reference to a string, i.e.
void addLocationList(DIE &Die, dwarf::Attribute Attribute, unsigned Index)
Add a Dwarf loclistptr attribute data and value.
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.