13 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H 14 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H 28 class DwarfCompileUnit;
30 class MCDwarfDwoLineTable;
223 bool SkipSPAttributes =
false);
251 return sizeof(int16_t) +
307 void constructTemplateTypeParameterDIE(
DIE &Buffer,
309 void constructTemplateValueParameterDIE(
DIE &Buffer,
315 int64_t getDefaultLowerBound()
const;
318 DIE *getIndexTyDie();
323 virtual void finishNonUnitTypeDIE(DIE&
D,
const DICompositeType *CTy) = 0;
327 void updateAcceleratorTables(
const DIScope *
Context,
const DIType *Ty,
330 virtual bool isDwoUnit()
const = 0;
331 const MCSymbol *getCrossSectionRelativeBaseAddress()
const override;
335 uint64_t TypeSignature;
339 bool UsedLineTable =
false;
341 unsigned getOrCreateSourceID(
const DIFile *
File)
override;
343 bool isDwoUnit()
const override;
const DICompileUnit * getCUNode() 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.
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
void addLabelDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
Add a label delta attribute data and value.
std::vector< DIELoc * > DIELocs
A list of all the DIELocs in use.
DIELoc - Represents an expression location.
This class represents lattice values for constants.
DIE * getOrCreateStaticMemberDIE(const DIDerivedType *DT)
Create new static data member DIE.
void addOpAddress(DIELoc &Die, const MCSymbol *Sym)
Add a dwarf op address data and value using the form given and an op of either DW_FORM_addr or DW_FOR...
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.
Collects and handles dwarf debug information.
DwarfTypeUnit(DwarfCompileUnit &CU, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU, MCDwarfDwoLineTable *SplitLineTable=nullptr)
bool useSegmentedStringOffsetsTable() const
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.
void constructTypeDIE(DIE &Buffer, const DICompositeType *CTy)
DIE * getDIE(const DINode *D) const
Returns the DIE map slot for the specified debug variable.
bool isShareableAcrossCUs(const DINode *D) const
Check whether the DIE for this MDNode can be shared across CUs.
void addConstantFPValue(DIE &Die, const ConstantFP *CFP)
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.
void addConstantValue(DIE &Die, const ConstantInt *CI, const DIType *Ty)
Add constant value entry in variable DIE.
DIE * getOrCreateTypeDIE(const MDNode *TyNode)
Find existing DIE or create new DIE for the given type.
void addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Loc)
Add block data.
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.
AsmPrinter * getAsmPrinter() const
DwarfCompileUnit & getCU() override
MCSymbol * EndLabel
Emitted at the end of the CU and used to compute the CU Length field.
DIE * getOrCreateNameSpace(const DINamespace *NS)
void applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie, bool SkipSPAttributes=false)
void addSourceLine(DIE &Die, unsigned Line, const DIFile *File)
Add location information to specified debug information entry.
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.
Instrumentation for Order File
String type, Fortran CHARACTER(n)
bool hasContent() const
Return true if this compile unit has something to write out.
A structured debug information entry.
DIELoc * getDIELoc()
Returns a fresh newly allocated DIELoc.
ConstantFP - Floating Point Values [float, double].
unsigned int getDwarfOffsetByteSize() const
Returns 4 for DWARF32 and 8 for DWARF64.
This class is intended to be used as a driving class for all asm writers.
DenseMap< const MDNode *, DIE * > MDNodeToDieMap
Tracks the mapping of unit level debug information variables to debug information entries.
virtual unsigned getOrCreateSourceID(const DIFile *File)=0
Look up the source ID for the given file.
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)
bool useSegmentedStringOffsetsTable() const
Returns whether to generate a string offsets table with (possibly shared) contributions from each CU ...
DwarfDebug & getDwarfDebug() const
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.
Base class for scope-like contexts.
std::string getParentContextString(const DIScope *Context) const
Get string containing language specific context for a global name.
UnitType
Constants for unit types in DWARF v5.
uint16_t getLanguage() const
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.
MCSymbol * getEndLabel() const
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.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void setTypeSignature(uint64_t Signature)
void addRnglistsBase()
Add the DW_AT_rnglists_base attribute to the unit DIE.
void addTemplateParams(DIE &Buffer, DINodeArray TParams)
Add template parameters in buffer.
unsigned getSourceLanguage() const
Class for arbitrary precision integers.
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
void setType(const DIE *Ty)
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.
void emitHeader(bool UseOffsets) override
Emit the header for this unit, not including the initial length field.
DIE * getOrCreateModule(const DIModule *M)
const DICompileUnit * CUNode
MDNode for the compile unit.
void addSectionOffset(DIE &Die, dwarf::Attribute Attribute, uint64_t Integer)
Add an offset into a section attribute data and value.
void addDIETypeSignature(DIE &Die, uint64_t Signature)
Add a type's DW_AT_signature and set the declaration flag.
BumpPtrAllocator DIEValueAllocator
DIE * createTypeDIE(const DIScope *Context, DIE &ContextDIE, const DIType *Ty)
Creates type DIE with specific context.
void addStringOffsetsStart()
Add the DW_AT_str_offsets_base attribute to the unit DIE.
std::vector< DIEBlock * > DIEBlocks
A list of all the DIEBlocks in use.
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
void addUInt(DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, uint64_t Integer)
Add an unsigned integer attribute data and value.
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.
DwarfUnit(dwarf::Tag, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Basic type, like 'int' or 'float'.