14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H
31 class MachineLocation;
36 class DwarfCompileUnit;
59 : RangeSym(Sym), Ranges(std::move(Ranges)) {}
259 bool SkipSPAttributes =
false);
280 return sizeof(int16_t) +
335 void constructTemplateTypeParameterDIE(
DIE &Buffer,
337 void constructTemplateValueParameterDIE(
DIE &Buffer,
343 int64_t getDefaultLowerBound()
const;
346 DIE *getIndexTyDie();
351 virtual bool isDwoUnit()
const = 0;
352 const MCSymbol *getCrossSectionRelativeBaseAddress()
const override;
356 uint64_t TypeSignature;
362 bool isDwoUnit()
const override;
void updateAcceleratorTables(const DIScope *Context, const DIType *Ty, const DIE &TyDIE)
If this is a named finished type then include it in the list of types for the accelerator tables...
const MCSymbol * getStart() const
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 addFlag(DIE &Die, dwarf::Attribute Attribute)
Add a flag that is true to the DIE.
void addLabelDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
Add a label delta attribute data and value.
const DICompileUnit * getCUNode() const
std::vector< DIELoc * > DIELocs
A list of all the DIELocs in use.
DIELoc - Represents an expression location.
DIE * getOrCreateStaticMemberDIE(const DIDerivedType *DT)
Create new static data member DIE.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void addThrownTypes(DIE &Die, DINodeArray ThrownTypes)
Add thrown types.
void insertDIE(const DINode *Desc, DIE *D)
Insert DIE into the map.
MachineInstrBuilder MachineInstrBuilder &DefMI const MCInstrDesc & Desc
Collects and handles dwarf debug information.
DwarfTypeUnit(DwarfCompileUnit &CU, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU, MCDwarfDwoLineTable *SplitLineTable=nullptr)
bool shareAcrossDWOCUs() const
DwarfUnit(dwarf::Tag, const DICompileUnit *CU, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
void addType(DIE &Entity, const DIType *Ty, dwarf::Attribute Attribute=dwarf::DW_AT_type)
Add a new type attribute to the specified entity.
DIE::value_iterator addSectionLabel(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label, const MCSymbol *Sec)
Add a Dwarf section label attribute data and value.
virtual DwarfCompileUnit & getCU()=0
AsmPrinter * Asm
Target of Dwarf emission.
Tagged DWARF-like metadata node.
DIE * getOrCreateTypeDIE(const MDNode *N)
Find existing DIE or create new DIE for the given type.
void constructTypeDIE(DIE &Buffer, const DICompositeType *CTy)
void addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Block)
Add block data.
virtual unsigned getOrCreateSourceID(StringRef File, StringRef Directory)=0
Look up the source ID with the given directory and source file names.
T * resolve(TypedDINodeRef< T > Ref) const
Look in the DwarfDebug map for the MDNode that corresponds to the reference.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void addConstantFPValue(DIE &Die, const MachineOperand &MO)
Add constant value entry in variable DIE.
void constructContainingTypeDIEs()
Construct DIEs for types that contain vtables.
virtual void emitHeader(bool UseOffsets)=0
Emit the header for this unit, not including the initial length field.
Holds a subclass of DINode.
DenseMap< DIE *, const DINode * > ContainingTypeMap
This map is used to keep track of subprogram DIEs that need DW_AT_containing_type attribute...
void addString(DIE &Die, dwarf::Attribute Attribute, StringRef Str)
Add a string attribute data and value.
This class is used to track local variable information.
DwarfCompileUnit & getCU() override
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
DIE * getOrCreateNameSpace(const DINamespace *NS)
void addConstantValue(DIE &Die, const MachineOperand &MO, const DIType *Ty)
Add constant value entry in variable DIE.
void applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie, bool SkipSPAttributes=false)
void addGlobalName(StringRef Name, const DIE &Die, const DIScope *Context) override
Add a new global name to the compile unit.
A pointer to another debug information entry.
This dwarf writer support class manages information associated with a source file.
DIEValueList::value_iterator addLabel(DIEValueList &Die, dwarf::Attribute Attribute, dwarf::Form Form, const MCSymbol *Label)
Add a Dwarf label attribute data and value.
bool applySubprogramDefinitionAttributes(const DISubprogram *SP, DIE &SPDie)
Allocate memory in an ever growing pool, as if by bump-pointer.
void addSourceLine(DIE &Die, unsigned Line, StringRef File, StringRef Directory)
Add location information to specified debug information entry.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
A structured debug information entry.
DIELoc * getDIELoc()
Returns a fresh newly allocated DIELoc.
ConstantFP - Floating Point Values [float, double].
unsigned getSourceLanguage() const
This class is intended to be used as a driving class for all asm writers.
void setEnd(const MCSymbol *E)
DenseMap< const MDNode *, DIE * > MDNodeToDieMap
Tracks the mapping of unit level debug information variables to debug information entries...
void emitCommonHeader(bool UseOffsets, dwarf::UnitType UT)
Emit the common part of the header for this unit.
DIE * getOrCreateSubprogramDIE(const DISubprogram *SP, bool Minimal=false)
void addSInt(DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, int64_t Integer)
Add an signed integer attribute data and value.
bool isShareableAcrossCUs(const DINode *D) const
Check whether the DIE for this MDNode can be shared across CUs.
DIE * IndexTyDie
An anonymous type for index type. Owned by DIEUnit.
DIE * getDIE(const DINode *D) const
Returns the DIE map slot for the specified debug variable.
Base class for scope-like contexts.
UnitType
Constants for unit types in DWARF v5.
unsigned getHeaderSize() const override
Compute the size of a header for this unit, not including the initial length field.
This is the shared class of boolean and integer constants.
uint16_t getLanguage() const
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void addLinkageName(DIE &Die, StringRef LinkageName)
Add a linkage name, if it isn't empty.
Represents a compile or type unit.
void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context) override
Add a new global type to the compile unit.
void setTypeSignature(uint64_t Signature)
void addTemplateParams(DIE &Buffer, DINodeArray TParams)
Add template parameters in buffer.
Class for arbitrary precision integers.
A (clang) module that has been imported by the compile unit.
void setType(const DIE *Ty)
const SmallVectorImpl< RangeSpan > & getRanges() const
std::string getParentContextString(const DIScope *Context) const
Get string containing language specific context for a global name.
void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry)
Add a DIE attribute data and value.
virtual void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context)=0
Add a new global type to the compile unit.
DIE * getOrCreateContextDIE(const DIScope *Context)
Get context owner's DIE.
Type array for a subprogram.
virtual void addGlobalName(StringRef Name, const DIE &Die, const DIScope *Context)=0
Add a new global name to the compile unit.
DIE & createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N=nullptr)
Create a DIE with the given Tag, add the DIE to its parent, and call insertDIE if MD is not null...
RangeSpan(MCSymbol *S, MCSymbol *E)
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
void emitHeader(bool UseOffsets) override
Emit the header for this unit, not including the initial length field.
DIE * getOrCreateModule(const DIModule *M)
void addBlockByrefAddress(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 addRange(RangeSpan Range)
const DICompileUnit * CUNode
MDNode for the compile unit.
AsmPrinter * getAsmPrinter() const
void addSectionOffset(DIE &Die, dwarf::Attribute Attribute, uint64_t Integer)
Add an offset into a section attribute data and value.
bool hasContent() const
Return true if this compile unit has something to write out.
void addDIETypeSignature(DIE &Die, uint64_t Signature)
Add a type's DW_AT_signature and set the declaration flag.
BumpPtrAllocator DIEValueAllocator
RangeSpanList(MCSymbol *Sym, SmallVector< RangeSpan, 2 > Ranges)
std::vector< DIEBlock * > DIEBlocks
A list of all the DIEBlocks in use.
void addUInt(DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, uint64_t Integer)
Add an unsigned integer attribute data and value.
void addOpAddress(DIELoc &Die, const MCSymbol *Label)
Add a dwarf op address data and value using the form given and an op of either DW_FORM_addr or DW_FOR...
StringRef - Represent a constant reference to a string, i.e.
DIEBlock - Represents a block of values.
void constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args)
Construct function argument DIEs.
MCSymbol * getSym() const
const MCSymbol * getEnd() const
DIE * createTypeDIE(const DICompositeType *Ty)
Get context owner's DIE.
Basic type, like 'int' or 'float'.