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)) {}
106 bool shareAcrossDWOCUs()
const;
107 bool isShareableAcrossCUs(
const DINode *
D)
const;
118 bool hasContent()
const {
return getUnitDie().hasChildren(); }
134 virtual void addGlobalType(
const DIType *Ty,
const DIE &Die,
152 void insertDIE(
const DINode *Desc,
DIE *D);
203 void addDIETypeSignature(
DIE &Die, uint64_t Signature);
212 void addSourceLine(
DIE &Die,
unsigned Line,
const DIFile *
File);
216 void addSourceLine(
DIE &Die,
const DIType *Ty);
222 void addConstantValue(
DIE &Die,
const APInt &Val,
const DIType *Ty);
224 void addConstantValue(
DIE &Die,
bool Unsigned, uint64_t Val);
234 void addTemplateParams(
DIE &Buffer, DINodeArray TParams);
237 void addThrownTypes(
DIE &Die, DINodeArray ThrownTypes);
252 void addType(
DIE &Entity,
const DIType *Ty,
257 DIE *getOrCreateSubprogramDIE(
const DISubprogram *SP,
bool Minimal =
false);
260 bool SkipSPAttributes =
false);
263 DIE *getOrCreateTypeDIE(
const MDNode *TyNode);
266 DIE *getOrCreateContextDIE(
const DIScope *Context);
269 void constructContainingTypeDIEs();
285 return sizeof(int16_t) +
293 virtual void emitHeader(
bool UseOffsets) = 0;
296 void addStringOffsetsStart();
299 void addRnglistsBase();
326 virtual unsigned getOrCreateSourceID(
const DIFile *File) = 0;
336 void updateAcceleratorTables(
const DIScope *Context,
const DIType *Ty,
350 void constructTemplateTypeParameterDIE(
DIE &Buffer,
352 void constructTemplateValueParameterDIE(
DIE &Buffer,
358 int64_t getDefaultLowerBound()
const;
361 DIE *getIndexTyDie();
364 void setIndexTyDie(
DIE *D) { IndexTyDie =
D; }
366 virtual bool isDwoUnit()
const = 0;
367 const MCSymbol *getCrossSectionRelativeBaseAddress()
const override;
371 uint64_t TypeSignature;
375 bool UsedLineTable =
false;
377 unsigned getOrCreateSourceID(
const DIFile *
File)
override;
378 bool isDwoUnit()
const override;
391 void emitHeader(
bool UseOffsets)
override;
398 void addGlobalType(
const DIType *Ty,
const DIE &Die,
399 const DIScope *Context)
override;
const DICompileUnit * getCUNode() const
void push_back(const T &Elt)
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
std::vector< DIELoc * > DIELocs
A list of all the DIELocs in use.
DIELoc - Represents an expression location.
Compute iterated dominance frontiers using a linear time algorithm.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Collects and handles dwarf debug information.
bool useSegmentedStringOffsetsTable() const
AsmPrinter * Asm
Target of Dwarf emission.
Tagged DWARF-like metadata node.
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...
The access may reference the value stored in memory.
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...
const SmallVectorImpl< RangeSpan > & getRanges() const
AsmPrinter * getAsmPrinter() const
This class is used to track local variable information.
DwarfCompileUnit & getCU() override
A pointer to another debug information entry.
This dwarf writer support class manages information associated with a source file.
MCSymbol * getSym() const
Allocate memory in an ever growing pool, as if by bump-pointer.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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.
void setEnd(const MCSymbol *E)
DenseMap< const MDNode *, DIE * > MDNodeToDieMap
Tracks the mapping of unit level debug information variables to debug information entries...
bool useSegmentedStringOffsetsTable() const
Returns whether to generate a string offsets table with (possibly shared) contributions from each CU ...
const MCSymbol * getStart() const
DIE * IndexTyDie
An anonymous type for index type. Owned by DIEUnit.
Base class for scope-like contexts.
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.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Represents a compile or type unit.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void setTypeSignature(uint64_t Signature)
unsigned getSourceLanguage() const
Class for arbitrary precision integers.
A (clang) module that has been imported by the compile unit.
void setType(const DIE *Ty)
Type array for a subprogram.
RangeSpan(MCSymbol *S, MCSymbol *E)
void addRange(RangeSpan Range)
const DICompileUnit * CUNode
MDNode for the compile unit.
uint16_t getDwarfVersion() const
BumpPtrAllocator DIEValueAllocator
const MCSymbol * getEnd() const
RangeSpanList(MCSymbol *Sym, SmallVector< RangeSpan, 2 > Ranges)
std::vector< DIEBlock * > DIEBlocks
A list of all the DIEBlocks in use.
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
StringRef - Represent a constant reference to a string, i.e.
DIEBlock - Represents a block of values.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Basic type, like 'int' or 'float'.