14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H 15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H 31 class MachineLocation;
36 class DwarfCompileUnit;
238 bool SkipSPAttributes =
false);
263 return sizeof(int16_t) +
331 void constructTemplateTypeParameterDIE(
DIE &Buffer,
333 void constructTemplateValueParameterDIE(
DIE &Buffer,
339 int64_t getDefaultLowerBound()
const;
342 DIE *getIndexTyDie();
345 void setIndexTyDie(
DIE *D) { IndexTyDie =
D; }
347 virtual bool isDwoUnit()
const = 0;
348 const MCSymbol *getCrossSectionRelativeBaseAddress()
const override;
352 uint64_t TypeSignature;
356 bool UsedLineTable =
false;
359 bool isDwoUnit()
const override;
380 const DIScope *Context)
override;
const DICompileUnit * getCUNode() const
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...
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.
MD5::MD5Result * getMD5AsBytes(const DIFile *File) const
If the File has an MD5 checksum, return it as an MD5Result allocated in the MCContext.
bool shareAcrossDWOCUs() const
void addLoclistsBase()
Add the DW_AT_loclists_base attribute to the unit DIE.
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.
T * resolve(TypedDINodeRef< T > Ref) const
Look in the DwarfDebug map for the MDNode that corresponds to the reference.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
bool isShareableAcrossCUs(const DINode *D) const
Check whether the DIE for this MDNode can be shared across CUs.
void addConstantFPValue(DIE &Die, const MachineOperand &MO)
Add constant value entry in variable DIE.
The access may reference the value stored in memory.
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.
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...
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
This class is used to track local variable information.
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 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 addSourceLine(DIE &Die, unsigned Line, const DIFile *File)
Add location information to specified debug information entry.
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.
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].
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 ...
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.
MachineOperand class - Representation of each machine instruction operand.
MCSymbol * getEndLabel() const
void addLinkageName(DIE &Die, StringRef LinkageName)
Add a linkage name, if it isn't empty.
Represents a compile or type 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.
A (clang) module that has been imported by the compile unit.
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...
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.
uint16_t getDwarfVersion() const
void addDIETypeSignature(DIE &Die, uint64_t Signature)
Add a type's DW_AT_signature and set the declaration flag.
BumpPtrAllocator DIEValueAllocator
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'.