35 "line-info-inlined-at",
46 Asm->OutStreamer->getContext().setDwarfVersion(2);
110 const bool EnhancedLineinfo =
112 (SP->getUnit()->isDebugDirectivesOnly() ||
117 const DIScope *Scope = EmitLoc->getScope();
127 WorkListSet.
insert(EmitLoc);
129 if (!EnhancedLineinfo)
132 const DILocation *IA = EmitLoc->getInlinedAt();
136 if (IA && !EmittedInlinedAtLocs.contains(IA))
142 const unsigned CUID =
Asm->OutStreamer->getContext().getDwarfCompileUnitID();
144 while (!WorkList.
empty()) {
146 const DIScope *Scope = Current->getScope();
151 const DILocation *InlinedAt = Current->getInlinedAt();
153 const unsigned Line = Current->getLine();
154 const unsigned Col = Current->getColumn();
155 unsigned Discriminator = 0;
158 Discriminator = LBF->getDiscriminator();
161 .getOrCreateSourceID(Scope->getFile());
163 if (EnhancedLineinfo && InlinedAt) {
165 .getOrCreateSourceID(InlinedAt->getFile());
168 *
Asm, SubProgram->getLinkageName());
169 Asm->OutStreamer->emitDwarfLocDirectiveWithInlinedAt(
170 FileNo, Line, Col, FileIA, InlinedAt->getLine(),
171 InlinedAt->getColumn(), Entry.getSymbol(), Flags, 0, Discriminator,
174 Asm->OutStreamer->emitDwarfLocDirective(FileNo, Line, Col, Flags, 0,
179 if (EnhancedLineinfo)
180 EmittedInlinedAtLocs.insert(Current);
186 EmittedInlinedAtLocs.clear();
218 "Cannot translate unknown address space to DWARF address space");
229 const DIExpression *Expr, std::optional<unsigned> &TargetAddrSpace)
const {
232 unsigned LocalAddrSpace;
236 TargetAddrSpace = LocalAddrSpace;
255 switch (VarLocKind) {
257 if (!TargetAddrSpace && GV)
270 CU.addUInt(Die, dwarf::DW_AT_address_class, dwarf::DW_FORM_data1,
271 TargetAddrSpace.value_or(DefaultAddrSpace));
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file contains constants used for implementing Dwarf debug support.
NVPTX address space definition.
static unsigned translateToNVVMDWARFAddrSpace(unsigned AddrSpace)
static cl::opt< bool > LineInfoWithInlinedAt("line-info-inlined-at", cl::desc("Emit line with inlined_at enhancement for NVPTX"), cl::init(true), cl::Hidden)
This class is intended to be used as a driving class for all asm writers.
A structured debug information entry.
static LLVM_ABI const DIExpression * extractAddressClass(const DIExpression *Expr, unsigned &AddrClass)
Checks if the last 4 elements of the expression are DW_OP_constu <DWARFAddress Space> DW_OP_swap DW_O...
Base class for scope-like contexts.
Subprogram description. Uses SubclassData1.
AsmPrinter * Asm
Target of debug info emission.
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
VariableLocationKind
Describes the storage kind of a debug variable for target hooks.
void setUseSectionsAsReferences(bool V)
void setUseRangesSection(bool V)
const SmallVectorImpl< std::unique_ptr< DwarfCompileUnit > > & getUnits()
DwarfFile InfoHolder
Holder for the file specific debug information.
void setUseInlineStrings(bool V)
Setters for target-specific DWARF configuration overrides.
DwarfDebug(AsmPrinter *A)
DwarfStringPoolEntryRef: Dwarf string pool entry reference.
DISubprogram * getSubprogram() const
Get the attached subprogram.
PointerType * getType() const
Global values are always pointers.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Function & getFunction()
Return the LLVM function that this machine code represents.
bool shouldResetBaseAddress(const MCSection &Section) const override
Whether the target requires resetting the base address in range/loc lists.
bool shouldAttachCompileUnitRanges() const override
Whether to attach ranges/low_pc to the compile unit DIE in endModule.
void recordTargetSourceLine(const DebugLoc &DL, unsigned Flags) override
NVPTX-specific source line recording with inlined_at support.
const DIExpression * adjustExpressionForTarget(const DIExpression *Expr, std::optional< unsigned > &TargetAddrSpace) const override
Extract target-specific address space information from a DIExpression.
NVPTXDwarfDebug(AsmPrinter *A)
void initializeTargetDebugInfo(const MachineFunction &MF) override
NVPTX-specific debug info initialization.
void addTargetVariableAttributes(DwarfCompileUnit &CU, DIE &Die, std::optional< unsigned > TargetAddrSpace, VariableLocationKind VarLocKind, const GlobalVariable *GV=nullptr) const override
Add target-specific attributes to a variable DIE (e.g.
unsigned getPTXVersion() const
unsigned getAddressSpace() const
Return the address space of the Pointer type.
Implements a dense probed hash-table based set with some number of buckets stored inline.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
std::pair< iterator, bool > insert(const ValueT &V)
bool contains(const_arg_type_t< ValueT > V) const
Check if the set contains the given element.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ DWARF_ADDR_shared_space
@ DWARF_ADDR_global_space
@ DWARF_ADDR_generic_space
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.