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 Minimal =
false);
283 return sizeof(int16_t) +
317 void constructTemplateTypeParameterDIE(
DIE &Buffer,
319 void constructTemplateValueParameterDIE(
DIE &Buffer,
325 int64_t getDefaultLowerBound()
const;
328 DIE *getIndexTyDie();
335 void updateAcceleratorTables(
const DIScope *
Context,
const DIType *Ty,
338 virtual bool isDwoUnit()
const = 0;
342 uint64_t TypeSignature;
348 bool isDwoUnit()
const override;
const MCSymbol * getStart() const
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 ...
virtual void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context)
Add a new global type to the compile unit.
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)
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.
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)
virtual void addGlobalName(StringRef Name, DIE &Die, const DIScope *Context)
Add a new global name to the compile unit.
void addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Block)
Add block data.
virtual void emitHeader(bool UseOffsets)
Emit the header for this unit, not including the initial length field.
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...
static GCRegistry::Add< StatepointGC > D("statepoint-example","an example strategy for statepoint")
void addConstantFPValue(DIE &Die, const MachineOperand &MO)
Add constant value entry in variable DIE.
void constructContainingTypeDIEs()
Construct DIEs for types that contain vtables.
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)
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
void addConstantValue(DIE &Die, const MachineOperand &MO, const DIType *Ty)
Add constant value entry in variable DIE.
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.
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...
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.
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.
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 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.
DIE * getOrCreateContextDIE(const DIScope *Context)
Get context owner's DIE.
Type array for a subprogram.
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)
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)
DIE * createTypeDIE(const DICompositeType *Ty)
Get context owner's DIE.
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 applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie, bool Minimal=false)
void constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args)
Construct function argument DIEs.
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
MCSymbol * getSym() const
const MCSymbol * getEnd() const
Basic type, like 'int' or 'float'.