32 "line-info-inlined-at",
99 const bool EnhancedLineinfo =
101 (SP->getUnit()->isDebugDirectivesOnly() ||
106 const DIScope *Scope = EmitLoc->getScope();
116 WorkListSet.
insert(EmitLoc);
118 if (!EnhancedLineinfo)
121 const DILocation *IA = EmitLoc->getInlinedAt();
125 if (IA && !EmittedInlinedAtLocs.contains(IA))
131 const unsigned CUID =
Asm->OutStreamer->getContext().getDwarfCompileUnitID();
133 while (!WorkList.
empty()) {
135 const DIScope *Scope = Current->getScope();
140 const DILocation *InlinedAt = Current->getInlinedAt();
142 const unsigned Line = Current->getLine();
143 const unsigned Col = Current->getColumn();
144 unsigned Discriminator = 0;
147 Discriminator = LBF->getDiscriminator();
150 .getOrCreateSourceID(Scope->getFile());
152 if (EnhancedLineinfo && InlinedAt) {
154 .getOrCreateSourceID(InlinedAt->getFile());
157 *
Asm, SubProgram->getLinkageName());
158 Asm->OutStreamer->emitDwarfLocDirectiveWithInlinedAt(
159 FileNo, Line, Col, FileIA, InlinedAt->getLine(),
160 InlinedAt->getColumn(), Entry.getSymbol(), Flags, 0, Discriminator,
163 Asm->OutStreamer->emitDwarfLocDirective(FileNo, Line, Col, Flags, 0,
168 if (EnhancedLineinfo)
169 EmittedInlinedAtLocs.insert(Current);
176 EmittedInlinedAtLocs.clear();
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
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.
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.
const SmallVectorImpl< std::unique_ptr< DwarfCompileUnit > > & getUnits()
DwarfFile InfoHolder
Holder for the file specific debug information.
DwarfDebug(AsmPrinter *A)
DwarfStringPoolEntryRef: Dwarf string pool entry reference.
DISubprogram * getSubprogram() const
Get the attached subprogram.
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.
void recordTargetSourceLine(const DebugLoc &DL, unsigned Flags) override
Override to record source line information with inlined_at support.
NVPTXDwarfDebug(AsmPrinter *A)
Constructor - Pass through to DwarfDebug constructor.
void initializeTargetDebugInfo(const MachineFunction &MF) override
Override to collect inlined_at locations.
unsigned getPTXVersion() const
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.
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.