Go to the documentation of this file.
13 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H
14 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H
28 class DwarfCompileUnit;
29 class MCDwarfDwoLineTable;
242 bool SkipSPAttributes =
false);
270 return sizeof(int16_t) +
328 void constructTemplateTypeParameterDIE(
DIE &Buffer,
330 void constructTemplateValueParameterDIE(
DIE &Buffer,
336 int64_t getDefaultLowerBound()
const;
339 DIE *getIndexTyDie();
344 virtual void finishNonUnitTypeDIE(DIE&
D,
const DICompositeType *CTy) = 0;
348 void updateAcceleratorTables(
const DIScope *
Context,
const DIType *Ty,
351 virtual bool isDwoUnit()
const = 0;
352 const MCSymbol *getCrossSectionRelativeBaseAddress()
const override;
360 bool UsedLineTable =
false;
362 unsigned getOrCreateSourceID(
const DIFile *File)
override;
364 bool isDwoUnit()
const override;
DIE * getOrCreateStaticMemberDIE(const DIDerivedType *DT)
Create new static data member DIE.
void addSourceLine(DIE &Die, unsigned Line, const DIFile *File)
Add location information to specified debug information entry.
bool isShareableAcrossCUs(const DINode *D) const
Check whether the DIE for this MDNode can be shared across CUs.
bool useSegmentedStringOffsetsTable() const
virtual unsigned getOrCreateSourceID(const DIFile *File)=0
Look up the source ID for the given file.
void addRnglistsBase()
Add the DW_AT_rnglists_base attribute to the unit DIE.
void addThrownTypes(DIE &Die, DINodeArray ThrownTypes)
Add thrown types.
This is an optimization pass for GlobalISel generic memory operations.
void setType(const DIE *Ty)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
virtual void emitHeader(bool UseOffsets)=0
Emit the header for this unit, not including the initial length field.
void addFlag(DIE &Die, dwarf::Attribute Attribute)
Add a flag that is true to the DIE.
DIE * getOrCreateContextDIE(const DIScope *Context)
Get context owner's DIE.
void emitCommonHeader(bool UseOffsets, dwarf::UnitType UT)
Emit the common part of the header for this unit.
Represents a compile or type unit.
String type, Fortran CHARACTER(n)
void addLabelDelta(DIEValueList &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
Add a label delta attribute data and value.
MCSymbol * getEndLabel() const
void insertDIE(const DINode *Desc, DIE *D)
Insert DIE into the map.
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...
DIE * getDIE(const DINode *D) const
Returns the DIE map slot for the specified debug variable.
DIE * getOrCreateSubprogramDIE(const DISubprogram *SP, bool Minimal=false)
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
void addString(DIE &Die, dwarf::Attribute Attribute, StringRef Str)
Add a string attribute data and value.
unsigned int getDwarfOffsetByteSize() const
Returns 4 for DWARF32 and 8 for DWARF64.
void addDIETypeSignature(DIE &Die, uint64_t Signature)
Add a type's DW_AT_signature and set the declaration flag.
A structured debug information entry.
void addSInt(DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, int64_t Integer)
Add an signed integer attribute data and value.
void constructTypeDIE(DIE &Buffer, const DICompositeType *CTy)
bool hasContent() const
Return true if this compile unit has something to write out.
Annotations lets you mark points and ranges inside source code, for tests:
This is the shared class of boolean and integer constants.
AsmPrinter * getAsmPrinter() const
void constructContainingTypeDIEs()
Construct DIEs for types that contain vtables.
void addSectionOffset(DIE &Die, dwarf::Attribute Attribute, uint64_t Integer)
Add an offset into a section attribute data and value.
void addConstantValue(DIE &Die, const ConstantInt *CI, const DIType *Ty)
Add constant value entry in variable DIE.
void addAnnotation(DIE &Buffer, DINodeArray Annotations)
Add DW_TAG_LLVM_annotation.
void addSectionLabel(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label, const MCSymbol *Sec)
Add a Dwarf section label attribute data and value.
std::vector< DIEBlock * > DIEBlocks
A list of all the DIEBlocks in use.
std::string getParentContextString(const DIScope *Context) const
Get string containing language specific context for a global name.
const DICompileUnit * CUNode
MDNode for the compile unit.
void applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie, bool SkipSPAttributes=false)
void addSectionDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
addSectionDelta - Add a label delta attribute data and value.
void addTemplateParams(DIE &Buffer, DINodeArray TParams)
Add template parameters in buffer.
const DICompileUnit * getCUNode() const
ConstantFP - Floating Point Values [float, double].
void addLinkageName(DIE &Die, StringRef LinkageName)
Add a linkage name, if it isn't empty.
DIEBlock - Represents a block of values.
BumpPtrAllocator DIEValueAllocator
unsigned getHeaderSize() const override
Compute the size of a header for this unit, not including the initial length field.
value_iterator addValue(BumpPtrAllocator &Alloc, const DIEValue &V)
DIELoc * getDIELoc()
Returns a fresh newly allocated DIELoc.
void addPoolOpAddress(DIEValueList &Die, const MCSymbol *Label)
DIE * getOrCreateModule(const DIModule *M)
unsigned getSourceLanguage() const
Collects and handles dwarf debug information.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
Allocate memory in an ever growing pool, as if by bump-pointer.
void addStringOffsetsStart()
Add the DW_AT_str_offsets_base attribute to the unit DIE.
DIELoc - Represents an expression location.
UnitType
Constants for unit types in DWARF v5.
AsmPrinter * Asm
Target of Dwarf emission.
unsigned AttributeVersion(Attribute A)
DenseMap< const MDNode *, DIE * > MDNodeToDieMap
Tracks the mapping of unit level debug information variables to debug information entries.
DwarfCompileUnit & getCU() override
A pointer to another debug information entry.
std::vector< DIELoc * > DIELocs
A list of all the DIELocs in use.
void emitHeader(bool UseOffsets) override
Emit the header for this unit, not including the initial length field.
void constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args)
Construct function argument DIEs.
DIE * IndexTyDie
An anonymous type for index type. Owned by DIEUnit.
Basic type, like 'int' or 'float'.
Class for arbitrary precision integers.
Type array for a subprogram.
DIE * getOrCreateTypeDIE(const MDNode *TyNode)
Find existing DIE or create new DIE for the given type.
DIE & createAndAddDIE(dwarf::Tag 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.
StringRef - Represent a constant reference to a string, i.e.
Tagged DWARF-like metadata node.
unsigned DebugStrictDwarf
When set to true, don't use DWARF extensions in later DWARF versions.
virtual void addGlobalName(StringRef Name, const DIE &Die, const DIScope *Context)=0
Add a new global name to the compile unit.
MCSymbol * EndLabel
Emitted at the end of the CU and used to compute the CU Length field.
DIE * getOrCreateNameSpace(const DINamespace *NS)
void addAttribute(DIEValueList &Die, dwarf::Attribute Attribute, dwarf::Form Form, T &&Value)
Base class for scope-like contexts.
void addUInt(DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, uint64_t Integer)
Add an unsigned integer attribute data and value.
void addAccess(DIE &Die, DINode::DIFlags Flags)
Add the accessibility attribute.
bool useSegmentedStringOffsetsTable() const
Returns whether to generate a string offsets table with (possibly shared) contributions from each CU ...
void addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Loc)
Add block data.
This class is intended to be used as a driving class for all asm writers.
void setTypeSignature(uint64_t Signature)
DIE * createTypeDIE(const DIScope *Context, DIE &ContextDIE, const DIType *Ty)
Creates type DIE with specific context.
void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context) override
Add a new global type to the compile unit.
virtual void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context)=0
Add a new global type to the compile unit.
DwarfTypeUnit(DwarfCompileUnit &CU, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU, MCDwarfDwoLineTable *SplitLineTable=nullptr)
void addLabel(DIEValueList &Die, dwarf::Attribute Attribute, dwarf::Form Form, const MCSymbol *Label)
Add a Dwarf label attribute data and value.
TargetMachine & TM
Target machine description.
bool applySubprogramDefinitionAttributes(const DISubprogram *SP, DIE &SPDie, bool Minimal)
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
DwarfDebug & getDwarfDebug() const
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
This dwarf writer support class manages information associated with a source file.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
DenseMap< DIE *, const DINode * > ContainingTypeMap
This map is used to keep track of subprogram DIEs that need DW_AT_containing_type attribute.
void addGlobalName(StringRef Name, const DIE &Die, const DIScope *Context) override
Add a new global name to the compile unit.
void addConstantFPValue(DIE &Die, const ConstantFP *CFP)
Add constant value entry in variable DIE.
uint16_t getLanguage() const
LLVM Value Representation.
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
DwarfUnit(dwarf::Tag, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry)
Add a DIE attribute data and value.