14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H 15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H 54 class DwarfCompileUnit;
58 class MachineFunction;
71 DIE *TheDIE =
nullptr;
81 : Entity(N), InlinedAt(IA), SubclassID(ID) {}
118 unsigned DebugLocListIndex = ~0u;
121 struct FrameIndexExpr {
138 assert(FrameIndexExprs.
empty() &&
"Already initialized?");
139 assert(!MInsn &&
"Already initialized?");
149 assert(FrameIndexExprs.
empty() &&
"Already initialized?");
150 assert(!MInsn &&
"Already initialized?");
158 if (
E->getNumElements())
164 return cast<DILocalVariable>(
getEntity());
169 return FrameIndexExprs.
size() ? FrameIndexExprs[0].Expr :
nullptr;
184 if (getVariable()->isParameter())
185 return dwarf::DW_TAG_formal_parameter;
187 return dwarf::DW_TAG_variable;
192 if (getVariable()->isArtificial())
200 if (getVariable()->isObjectPointer())
202 if (
getType()->isObjectPointer())
208 assert(MInsn &&
"Expected DBG_VALUE, not MMI variable");
210 (FrameIndexExprs.
size() == 1 &&
211 FrameIndexExprs[0].Expr->getNumElements())) &&
212 "Invalid Expr for DBG_VALUE");
213 return !FrameIndexExprs.
empty();
216 bool isBlockByrefVariable()
const;
251 return dwarf::DW_TAG_label;
292 std::vector<SymbolCU> ArangeLabels;
334 TypeUnitsUnderConstruction;
337 bool UseGNUTLSOpcode;
340 bool UseDWARF2Bitfields;
343 bool UseAllLinkageNames;
346 bool UseInlineStrings =
false;
349 bool UseRangesSection =
true;
353 bool UseSectionsAsReferences =
false;
356 bool UseLocSection =
true;
359 bool GenerateTypeUnits;
364 bool HasAppleExtensionAttributes;
371 bool UseSegmentedStringOffsetsTable;
433 template <
typename DataT>
437 void finishEntityDefinitions();
439 void finishSubprogramDefinitions();
443 void finalizeModuleInfo();
446 void emitDebugInfo();
449 void emitAbbreviations();
452 void emitStringOffsetsTableHeader();
455 template <
typename AccelTableT>
459 void emitAccelDebugNames();
462 void emitAccelNames();
466 void emitAccelObjC();
469 void emitAccelNamespaces();
472 void emitAccelTypes();
475 void emitDebugPubSections();
477 void emitDebugPubSection(
bool GnuStyle,
StringRef Name,
488 void emitDebugLocDWO();
491 void emitDebugARanges();
494 void emitDebugRanges();
495 void emitDebugRangesDWO();
498 void emitDebugMacinfo();
507 std::unique_ptr<DwarfCompileUnit> NewU);
519 void emitDebugInfoDWO();
522 void emitDebugAbbrevDWO();
525 void emitDebugLineDWO();
528 void emitStringOffsetsTableHeaderDWO();
531 void emitDebugStrDWO();
534 void emitDebugAddr();
553 void recordSourceLine(
unsigned Line,
unsigned Col,
const MDNode *Scope,
579 void skippedNonDebugFunction()
override;
594 void endModule()
override;
600 static uint64_t makeTypeSignature(
StringRef Identifier);
605 DIE &Die,
const DICompositeType *CTy);
636 return UseSectionsAsReferences;
651 return HasAppleExtensionAttributes;
665 return UseSegmentedStringOffsetsTable;
668 bool shareAcrossDWOCUs()
const;
671 uint16_t getDwarfVersion()
const;
717 return CUDieMap.
lookup(Die);
729 void addSectionLabel(
const MCSymbol *Sym);
735 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H
Instances of this class represent a uniqued identifier for a section in the current translation unit...
void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override
For symbols that have a size designated (e.g.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
unsigned getDebugLocListIndex() const
static bool classof(const DbgEntity *N)
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
Implements a dense probed hash-table based set.
void push_back(const T &Elt)
AccelTableKind getAccelTableKind() const
Returns what kind (if any) of accelerator tables to emit.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
const DebugLocStream & getDebugLocs() const
Returns the entries for the .debug_loc section.
Collects and handles dwarf debug information.
This class holds an abstract representation of an Accelerator Table, consisting of a sequence of buck...
bool useGNUTLSOpcode() const
Returns whether to use DW_OP_GNU_push_tls_address, instead of the standard DW_OP_form_tls_address opc...
This class is defined as the common parent of DbgVariable and DbgLabel such that it could levarage po...
This class implements a map that also provides access to all stored values in a deterministic order...
LexicalScope - This class is used to track scope information.
const MachineFunction * getCurrentFunction() const
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
Tagged DWARF-like metadata node.
DebuggerKind
Identify a debugger for "tuning" the debug info.
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support...
void initializeDbgValue(const MachineInstr *DbgValue)
Initialize from a DBG_VALUE instruction.
static bool classof(const DbgEntity *N)
const MCSymbol * getSymbol() const
amdgpu Simplify well known AMD library false Value Value const Twine & Name
void addArangeLabel(SymbolCU SCU)
Add a label so that arange data can be generated for it.
bool isObjectPointer() const
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.
AccelTableKind
The kind of accelerator tables we should emit.
AddressPool & getAddressPool()
const DIExpression * getSingleExpression() const
This class is used to track local variable information.
const DILocalVariable * getVariable() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
.apple_names, .apple_namespaces, .apple_types, .apple_objc.
const SmallVectorImpl< std::unique_ptr< DwarfCompileUnit > > & getUnits()
const MachineInstr * getMInsn() const
const DwarfCompileUnit * getPrevCU() const
Returns the previous CU that was being updated.
bool hasComplexAddress() const
This class is used to track label information.
This dwarf writer support class manages information associated with a source file.
Allocate memory in an ever growing pool, as if by bump-pointer.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
A structured debug information entry.
This class is intended to be used as a driving class for all asm writers.
bool useDWARF2Bitfields() const
Returns whether to use the DWARF2 format for bitfields instyead of the DWARF4 format.
bool hasFrameIndexExprs() const
bool useSegmentedStringOffsetsTable() const
Returns whether to generate a string offsets table with (possibly shared) contributions from each CU ...
const DILabel * getLabel() const
Accessors.
dwarf::Tag getTag() const
T * resolve(TypedDINodeRef< T > Ref) const
Find the MDNode for the given reference.
Helper used to pair up a symbol and its DWARF compile unit.
void initializeMMI(const DIExpression *E, int FI)
Initialize from the MMI table.
bool useAllLinkageNames() const
Returns whether we should emit all DW_AT_[MIPS_]linkage_name.
static wasm::ValType getType(const TargetRegisterClass *RC)
SymbolCU(DwarfCompileUnit *CU, const MCSymbol *Sym)
const DILocation * getInlinedAt() const
std::pair< const DINode *, const DILocation * > InlinedEntity
const DIExpression * getDebugExpression() const
Return the complex address expression referenced by this DBG_VALUE instruction.
An imported module (C++ using directive or similar).
bool useLocSection() const
Returns whether .debug_loc section should be emitted.
bool useSectionsAsReferences() const
Returns whether to use sections as labels rather than temp symbols.
StringRef getName() const
void setPrevCU(const DwarfCompileUnit *PrevCU)
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
DwarfCompileUnit * lookupCU(const DIE *Die)
Find the matching DwarfCompileUnit for the given CU DIE.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static bool classof(const DbgEntity *N)
bool useAppleExtensionAttributes() const
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
This file contains constants used for implementing Dwarf debug support.
StringRef getName() const
const DwarfCompileUnit * lookupCU(const DIE *Die) const
dwarf::Tag getTag() const
Translate tag to proper Dwarf tag.
Representation of each machine instruction.
LLVM_NODISCARD bool empty() const
bool useRangesSection() const
Returns whether ranges section should be emitted.
DbgLabel(const DILabel *L, const DILocation *IA, const MCSymbol *Sym=nullptr)
Symbol before DBG_LABEL instruction.
unsigned getDbgEntityID() const
Base class for debug information backends.
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
void setDebugLocListIndex(unsigned O)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A vector that has set insertion semantics.
const DILocalVariable * getDebugVariable() const
Return the debug variable referenced by this DBG_VALUE instruction.
unsigned getUnits(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &MCI)
Return the slots used by the insn.
DbgVariable(const DILocalVariable *V, const DILocation *IA)
Frame index + expression.
const DINode * getEntity() const
Accessors.
StringRef - Represent a constant reference to a string, i.e.
Byte stream of .debug_loc entries.
bool generateTypeUnits() const
Returns whether to generate DWARF v4 type units.
bool isArtificial() const
Return true if DbgVariable is artificial.
DbgEntity(const DINode *N, const DILocation *IA, unsigned ID)
bool useInlineStrings() const
Returns whether to use inline strings.