18#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVNONSEMANTICDEBUGHANDLER_H
19#define LLVM_LIB_TARGET_SPIRV_SPIRVNONSEMANTICDEBUGHANDLER_H
55 static constexpr unsigned NSSet =
static_cast<unsigned>(
56 SPIRV::InstructionSet::NonSemantic_Shader_DebugInfo_100);
58 struct CompileUnitInfo {
61 unsigned SpirvSourceLanguage = 0;
65 int64_t DwarfVersion = 0;
100 struct GlobalVariableDebugInfo {
105 GlobalVariableDebugInfoMap;
146 bool NonSemanticOpStringsSectionEmitted =
false;
180 bool GlobalDIEmitted =
false;
184 bool GlobalNSDIEnabled =
false;
192 bool DebugFunctionDefinitionEmitted =
false;
260 void emitDebugFunctionDefinition(
MCRegister DebugFunctionReg,
264 void resetPerFunctionDebugState();
272 std::optional<const MachineInstr *>
280 void emitMCInst(
MCInst &Inst);
305 getCachedScopePathOpStringReg(
const DIScope *Scope,
306 bool UseEmptyPathIfNullScope =
false);
309 MCRegister emitExtInst(SPIRV::NonSemanticExtInst::NonSemanticExtInst Opcode,
345 std::optional<MCRegister>
351 std::optional<MCRegister>
365 std::optional<MCRegister>
372 std::optional<MCRegister> emitDebugFunction(
const DISubprogram *SP,
390 std::optional<MCRegister>
412 std::optional<MCRegister> emitDebugGlobalVariable(
440 std::optional<MCRegister>
459 std::optional<MCRegister> emitDebugExpression(
const DIExpression *Expr,
481 std::optional<MCRegister> emitDebugTypeVector(
const DICompositeType *VT,
496 std::optional<MCRegister> emitDebugTypeArray(
const DICompositeType *AT,
507 std::optional<MCRegister> emitDebugTypeMember(
const DIDerivedType *M,
519 std::optional<MCRegister> emitDebugTypeComposite(
533 std::optional<MCRegister> emitDebugTypedef(
const DIDerivedType *TD,
550 std::optional<MCRegister> mapDISignatureTypeToReg(
const DIType *Ty,
556 static unsigned toNSDISrcLang(
unsigned DwarfSrcLang);
582 std::optional<MCRegister>
593 std::optional<MCRegister>
This file defines the StringMap class.
This file defines the DenseMap class.
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static NVPTX::Scope resolveScope(NVPTX::Scope S, const NVPTXSubtarget *T)
This file implements a set that has insertion order iteration characteristics.
This file defines the SmallString class.
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class is intended to be used as a driving class for all asm writers.
A lightweight wrapper around an expression operand.
Base class for scope-like contexts.
Subprogram description. Uses SubclassData1.
Type array for a subprogram.
DebugHandlerBase(AsmPrinter *A)
Instances of this class represent a single low-level machine instruction.
Wrapper class representing physical registers. Should be passed by value.
Representation of each machine instruction.
This class implements a map that also provides access to all stored values in a deterministic order.
A Module instance is used to store all the information related to an LLVM module.
void beginInstruction(const MachineInstr *MI) override
Process beginning of an instruction.
void endModule() override
Emit all sections that should come after the content.
void emitNonSemanticDebugStrings(SPIRV::ModuleAnalysisInfo &MAI)
Emit OpString instructions for all NSDI file paths and basic type names into the debug section (secti...
void beginModule(Module *M) override
Collect compile-unit metadata from the module.
void endFunctionImpl(const MachineFunction *MF) override
void beginFunctionImpl(const MachineFunction *MF) override
void emitNonSemanticGlobalDebugInfo(SPIRV::ModuleAnalysisInfo &MAI)
Emit module-scope NSDI instructions (DebugSource, DebugCompilationUnit, DebugTypeBasic,...
void prepareModuleOutput(const SPIRVSubtarget &ST, SPIRV::ModuleAnalysisInfo &MAI)
Add SPV_KHR_non_semantic_info extension and NonSemantic.Shader.DebugInfo.100 ext inst set entry to MA...
SPIRVNonSemanticDebugHandler(AsmPrinter &AP)
void endInstruction() override
Process end of an instruction.
void notifyEntryLabelEmitted(const MachineFunction &MF)
Called after the synthesized entry OpLabel has been emitted.
A vector that has set insertion semantics.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Represent a constant reference to a string, i.e.
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
DWARFExpression::Operation Op