38 Asm->OutStreamer->getContext().setDwarfVersion(2);
49 return STI.
getCLOpts().line_info_inlined_at &&
50 (STI.hasFeature(NVPTX::PTX72)) && SP &&
51 (SP->getUnit()->isDebugDirectivesOnly() ||
118 const DIScope *Scope = EmitLoc->getScope();
128 WorkListSet.
insert(EmitLoc);
130 if (!EnhancedLineinfo)
133 const DILocation *IA = EmitLoc->getInlinedAt();
137 if (IA && !EmittedInlinedAtLocs.contains(IA))
143 const unsigned CUID =
Asm->OutStreamer->getContext().getDwarfCompileUnitID();
145 while (!WorkList.
empty()) {
147 const DIScope *Scope = Current->getScope();
152 const DILocation *InlinedAt = Current->getInlinedAt();
154 const unsigned Line = Current->getLine();
155 const unsigned Col = Current->getColumn();
156 unsigned Discriminator = 0;
159 Discriminator = LBF->getDiscriminator();
162 .getOrCreateSourceID(Scope->getFile());
164 if (EnhancedLineinfo && InlinedAt) {
166 .getOrCreateSourceID(InlinedAt->getFile());
169 *
Asm, SubProgram->getLinkageName());
170 Asm->OutStreamer->emitDwarfLocDirectiveWithInlinedAt(
171 FileNo, Line, Col, FileIA, InlinedAt->getLine(),
172 InlinedAt->getColumn(), Entry.getSymbol(), Flags, 0, Discriminator,
175 Asm->OutStreamer->emitDwarfLocDirective(FileNo, Line, Col, Flags, 0,
180 if (EnhancedLineinfo)
181 EmittedInlinedAtLocs.insert(Current);
187 EmittedInlinedAtLocs.clear();
219 "Cannot translate unknown address space to DWARF address space");
230 const DIExpression *Expr, std::optional<unsigned> &TargetAddrSpace)
const {
233 unsigned LocalAddrSpace;
237 TargetAddrSpace = LocalAddrSpace;
256 switch (VarLocKind) {
258 if (!TargetAddrSpace && GV)
271 CU.addUInt(Die, dwarf::DW_AT_address_class, dwarf::DW_FORM_data1,
272 TargetAddrSpace.value_or(DefaultAddrSpace));
282 "Invalid or unsupported NVPTX language dialect.");
287 dwarf::DW_FORM_data1, Dialect);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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)
This class is intended to be used as a driving class for all asm writers.
DISourceLanguageName getSourceLanguage() const
A structured debug information entry.
static LLVM_ABI const DIExpression * extractAddressClass(const DIExpression *Expr, unsigned &AddrClass)
Checks if the expression ends with <DWARF Address Space> DW_OP_swap DW_OP_xderef[_size],...
Base class for scope-like contexts.
uint16_t getDialect() const
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()
void setTheAccelTableKind(AccelTableKind K)
Seet TheAccelTableKind.
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.
void addUInt(DIEValueList &Die, dwarf::Attribute Attribute, std::optional< dwarf::Form > Form, uint64_t Integer)
Add an unsigned integer attribute data and value.
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.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
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.
void finishTargetUnitAttributes(const DICompileUnit &DIUnit, DwarfCompileUnit &NewCU) override
Target-specific compile unit attribute finalization.
bool isEnhancedLineinfo(const MachineFunction &MF) const
Returns true if the enhanced lineinfo mode (with inlined_at) is active for the given MachineFunction.
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.
MCSymbol * getOrCreateFuncNameSymbol(StringRef LinkageName)
Get or create an MCSymbol in .debug_str for a function's linkage name.
const NVPTXOptions & getCLOpts() 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.
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
@ DW_LLVM_LANG_DIALECT_max
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.