Go to the documentation of this file.
13 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
14 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
49 bool HasRangeLists =
false;
80 const MCSymbol *BaseAddress =
nullptr;
88 const DIFile *LastFile =
nullptr;
93 DIE *constructVariableDIEImpl(
const DbgVariable &DV,
bool Abstract);
95 bool isDwoUnit()
const override;
99 return AbstractSPDies;
105 return AbstractEntities;
177 if (!isa<DILocalScope>(
Scope))
181 auto *LocalScope = cast<DILocalScope>(
Scope)->getNonLexicalBlockFileScope();
182 ImportedEntities[LocalScope].push_back(
IE);
219 DIE *&ObjectPointer);
255 bool IsTail,
const MCSymbol *PCAddr,
256 const MCSymbol *CallAddr,
unsigned CallReg);
296 assert(LabelBegin &&
"LabelBegin is not initialized");
301 return MacroLabelBegin;
366 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
DwarfCompileUnit(unsigned UID, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU, UnitKind Kind=UnitKind::Full)
void emitHeader(bool UseOffsets) override
Emit the header for this unit, not including the initial length field.
void addGlobalName(StringRef Name, const DIE &Die, const DIScope *Context) override
Add a new global name to the compile unit.
DIE & constructSubprogramScopeDIE(const DISubprogram *Sub, LexicalScope *Scope)
Construct a DIE for this subprogram scope.
DwarfCompileUnit & getCU() override
This is an optimization pass for GlobalISel generic memory operations.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
DIE * constructInlinedScopeDIE(LexicalScope *Scope)
This scope represents inlined body of a function.
MCSymbol * getLineTableStartSym() const
Get line table start symbol for this unit.
std::vector< BaseTypeRef > ExprRefedBaseTypes
const StringMap< const DIE * > & getGlobalNames() const
This class is defined as the common parent of DbgVariable and DbgLabel such that it could levarage po...
DenseMap< const MDNode *, DIE * > & getAbstractSPDies()
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
DIE * createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE)
LexicalScope - This class is used to track scope information.
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...
void attachRangesOrLowHighPC(DIE &D, SmallVector< RangeSpan, 2 > Ranges)
void createBaseTypeDIEs()
DIE & updateSubprogramScopeDIE(const DISubprogram *SP)
Find DIE for the given subprogram and attach appropriate DW_AT_low_pc and DW_AT_high_pc attributes.
const StringMap< const DIE * > & getGlobalTypes() const
A structured debug information entry.
This class is used to track label information.
DIE * getOrCreateCommonBlock(const DICommonBlock *CB, ArrayRef< GlobalExpr > GlobalExprs)
DIE * constructLexicalScopeDIE(LexicalScope *Scope)
Construct new DW_TAG_lexical_block for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels.
DIE * constructLabelDIE(DbgLabel &DL, const LexicalScope &Scope)
Construct a DIE for the given DbgLabel.
const DIExpression * Expr
BaseTypeRef(unsigned BitSize, dwarf::TypeKind Encoding)
DbgEntity * getExistingAbstractEntity(const DINode *Node)
void constructScopeDIE(LexicalScope *Scope, DIE &ParentScopeDIE)
SmallVector< RangeSpan, 2 > takeRanges()
void addScopeRangeList(DIE &ScopeDIE, SmallVector< RangeSpan, 2 > Range)
A helper function to construct a RangeSpanList for a given lexical scope.
void setDWOId(uint64_t DwoId)
dwarf::Attribute getDwarf5OrGNUAttr(dwarf::Attribute Attr) const
This takes a DWARF 5 attribute and returns it or a GNU analog.
DIE * constructVariableDIE(DbgVariable &DV, bool Abstract=false)
constructVariableDIE - Construct a DIE for the given DbgVariable.
void addLocationList(DIE &Die, dwarf::Attribute Attribute, unsigned Index)
Add a Dwarf loclistptr attribute data and value.
void addLocationAttribute(DIE *ToDIE, const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
std::pair< const DINode *, const DILocation * > InlinedEntity
uint64_t getDWOId() const
void addBaseTypeRef(DIEValueList &Die, int64_t Idx)
This class is used to track local variable information.
void applySubprogramAttributesToDefinition(const DISubprogram *SP, DIE &SPDie)
void attachLowHighPC(DIE &D, const MCSymbol *Begin, const MCSymbol *End)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope)
dwarf::LocationAtom getDwarf5OrGNULocationAtom(dwarf::LocationAtom Loc) const
This takes a DWARF 5 location atom and either returns it or a GNU analog.
void setSkeleton(DwarfCompileUnit &Skel)
Set the skeleton unit associated with this unit.
void addVariableAddress(const DbgVariable &DV, DIE &Die, MachineLocation Location)
Add DW_AT_location attribute for a DbgVariable based on provided MachineLocation.
A pair of GlobalVariable and DIExpression.
MCSymbol * getMacroLabelBegin() const
DIE * getOrCreateGlobalVariableDIE(const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
Get or create global variable DIE.
bool hasDwarfPubSections() const
Collects and handles dwarf debug information.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void addGlobalNameForTypeUnit(StringRef Name, const DIScope *Context)
Add a new global name present in a type unit to this compile unit.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support.
unsigned getOrCreateSourceID(const DIFile *File) override
Look up the source ID for the given file.
An imported module (C++ using directive or similar).
void finishSubprogramDefinition(const DISubprogram *SP)
DIELoc - Represents an expression location.
AsmPrinter * Asm
Target of Dwarf emission.
void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context) override
Add a new global type to the compile unit.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void finishEntityDefinition(const DbgEntity *Entity)
A Module instance is used to store all the information related to an LLVM module.
DIE * constructImportedEntityDIE(const DIImportedEntity *Module)
Construct import_module DIE.
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...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
void applyLabelAttributes(const DbgLabel &Label, DIE &LabelDie)
Scope
Defines the scope in which this symbol should be visible: Default – Visible in the public interface o...
StringRef - Represent a constant reference to a string, i.e.
DenseMap< const DINode *, std::unique_ptr< DbgEntity > > & getAbstractEntities()
Tagged DWARF-like metadata node.
void addRange(RangeSpan Range)
addRange - Add an address range to the list of ranges for this unit.
void addAddrTableBase()
Add the DW_AT_addr_base attribute to the unit DIE.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
const MCSymbol * getBaseAddress() const
void applyVariableAttributes(const DbgVariable &Var, DIE &VariableDie)
unsigned int getUnitLengthFieldByteSize() const
Returns 4 for DWARF32 and 12 for DWARF64.
bool shareAcrossDWOCUs() const
void setBaseAddress(const MCSymbol *Base)
void createAbstractEntity(const DINode *Node, LexicalScope *Scope)
Base class for scope-like contexts.
bool useGNUAnalogForDwarf5Feature() const
Whether to use the GNU analog for a DWARF5 tag, attribute, or location atom.
void applyStmtList(DIE &D)
Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
void addGlobalTypeUnitType(const DIType *Ty, const DIScope *Context)
Add a new global type present in a type unit to this compile unit.
void addLocalLabelAddress(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
addLocalLabelAddress - Add a dwarf label attribute data and value using DW_FORM_addr only.
This class is intended to be used as a driving class for all asm writers.
bool includeMinimalInlineScopes() const
DwarfCompileUnit * getSkeleton() const
void constructCallSiteParmEntryDIEs(DIE &CallSiteDIE, SmallVector< DbgCallSiteParam, 4 > &Params)
Construct call site parameter DIEs for the CallSiteDIE.
void addImportedEntity(const DIImportedEntity *IE)
unsigned getHeaderSize() const override
Compute the size of a header for this unit, not including the initial length field.
dwarf::Tag getDwarf5OrGNUTag(dwarf::Tag Tag) const
This takes a DWARF 5 tag and returns it or a GNU analog.
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
const GlobalVariable * Var
This dwarf writer support class manages information associated with a source file.
bool hasRangeLists() const
DIE & constructCallSiteEntryDIE(DIE &ScopeDIE, const DISubprogram *CalleeSP, bool IsTail, const MCSymbol *PCAddr, const MCSymbol *CallAddr, unsigned CallReg)
Construct a call site entry DIE describing a call within Scope to a callee described by CalleeSP.
void addAddress(DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
Add an address attribute to a die based on the location provided.
unsigned getUniqueID() const
MCSymbol * getLabelBegin() const
const SmallVectorImpl< RangeSpan > & getRanges() const
getRanges - Get the list of ranges for this unit.
Base class for the full range of assembler expressions which are needed for parsing.
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
DbgValueHistoryMap::InlinedEntity InlinedEntity
Find abstract variable associated with Var.
void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr)
Add a Dwarf expression attribute data and value.