14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H 15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H 54 class DwarfCompileUnit;
58 class MachineFunction;
79 DIE *TheDIE =
nullptr;
80 unsigned DebugLocListIndex = ~0u;
83 struct FrameIndexExpr {
100 assert(FrameIndexExprs.
empty() &&
"Already initialized?");
101 assert(!MInsn &&
"Already initialized?");
111 assert(FrameIndexExprs.
empty() &&
"Already initialized?");
112 assert(!MInsn &&
"Already initialized?");
119 if (
E->getNumElements())
129 return FrameIndexExprs.
size() ? FrameIndexExprs[0].Expr :
nullptr;
147 return dwarf::DW_TAG_formal_parameter;
149 return dwarf::DW_TAG_variable;
170 assert(MInsn &&
"Expected DBG_VALUE, not MMI variable");
172 (FrameIndexExprs.
size() == 1 &&
173 FrameIndexExprs[0].Expr->getNumElements())) &&
174 "Invalid Expr for DBG_VALUE");
175 return !FrameIndexExprs.
empty();
215 std::vector<SymbolCU> ArangeLabels;
255 TypeUnitsUnderConstruction;
258 bool UseGNUTLSOpcode;
261 bool UseDWARF2Bitfields;
264 bool UseAllLinkageNames;
267 bool UseInlineStrings =
false;
270 bool UsePubSections =
true;
273 bool UseRangesSection =
true;
277 bool UseSectionsAsReferences =
false;
280 bool UseLocSection =
true;
283 bool GenerateTypeUnits;
288 bool HasAppleExtensionAttributes;
295 bool UseSegmentedStringOffsetsTable;
339 void ensureAbstractVariableIsCreatedIfScoped(
DwarfCompileUnit &CU, InlinedVariable IV,
348 template <
typename DataT>
352 void finishVariableDefinitions();
354 void finishSubprogramDefinitions();
358 void finalizeModuleInfo();
361 void emitDebugInfo();
364 void emitAbbreviations();
367 void emitStringOffsetsTableHeader();
370 template <
typename AccelTableT>
374 void emitAccelDebugNames();
377 void emitAccelNames();
381 void emitAccelObjC();
384 void emitAccelNamespaces();
387 void emitAccelTypes();
390 void emitDebugPubSections();
392 void emitDebugPubSection(
bool GnuStyle,
StringRef Name,
403 void emitDebugLocDWO();
406 void emitDebugARanges();
409 void emitDebugRanges();
412 void emitDebugRnglists();
415 void emitDebugMacinfo();
424 std::unique_ptr<DwarfCompileUnit> NewU);
436 void emitDebugInfoDWO();
439 void emitDebugAbbrevDWO();
442 void emitDebugLineDWO();
445 void emitStringOffsetsTableHeaderDWO();
448 void emitDebugStrDWO();
451 void emitDebugAddr();
468 void recordSourceLine(
unsigned Line,
unsigned Col,
const MDNode *Scope,
494 void skippedNonDebugFunction()
override;
509 void endModule()
override;
520 DIE &Die,
const DICompositeType *CTy);
554 return UseSectionsAsReferences;
569 return HasAppleExtensionAttributes;
583 return UseSegmentedStringOffsetsTable;
586 bool shareAcrossDWOCUs()
const;
589 uint16_t getDwarfVersion()
const;
621 void addAccelType(
StringRef Name,
const DIE &Die,
char Flags);
632 return CUDieMap.
lookup(Die);
647 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H bool isObjectPointer() const
Instances of this class represent a uniqued identifier for a section in the current translation unit...
void push_back(const T &Elt)
const DILocation * getInlinedAt() const
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
void addMMIEntry(const DbgVariable &V)
Compute iterated dominance frontiers using a linear time algorithm.
std::pair< const DILocalVariable *, const DILocation * > InlinedVariable
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.
const DIType * getType() const
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 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.
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.
void addArangeLabel(SymbolCU SCU)
Add a label so that arange data can be generated for it.
StringRef getName() const
bool isObjectPointer() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isArtificial() const
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 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 ...
bool isObjectPointer() const
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.
SymbolCU(DwarfCompileUnit *CU, const MCSymbol *Sym)
const DIExpression * getDebugExpression() const
Return the complex address expression referenced by this DBG_VALUE instruction.
ArrayRef< FrameIndexExpr > getFrameIndexExprs() const
Get the FI entries, sorted by fragment offset.
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.
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")
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
Representation of each machine instruction.
bool isArtificial() const
LLVM_NODISCARD bool empty() const
bool useRangesSection() const
Returns whether ranges section should be emitted.
bool isBlockByrefVariable() const
Base class for debug information backends.
bool usePubSections() const
Returns whether GNU pub sections should be emitted.
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.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
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.
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.
bool useInlineStrings() const
Returns whether to use inline strings.