|
LLVM 23.0.0git
|
AsmPrinter handler that emits NonSemantic.Shader.DebugInfo.100 (NSDI) instructions for the SPIR-V backend. More...
#include "Target/SPIRV/SPIRVNonSemanticDebugHandler.h"
Public Member Functions | |
| SPIRVNonSemanticDebugHandler (AsmPrinter &AP) | |
| void | beginModule (Module *M) override |
| Collect compile-unit metadata from the module. | |
| void | emitNonSemanticDebugStrings (SPIRV::ModuleAnalysisInfo &MAI) |
| Emit OpString instructions for all NSDI file paths and basic type names into the debug section (section 7 of the SPIR-V module layout). | |
| 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 MAI. | |
| void | emitNonSemanticGlobalDebugInfo (SPIRV::ModuleAnalysisInfo &MAI) |
| Emit module-scope NSDI instructions (DebugSource, DebugCompilationUnit, DebugTypeBasic, DebugTypePointer). | |
| Public Member Functions inherited from llvm::DebugHandlerBase | |
| ~DebugHandlerBase () override | |
| void | beginFunction (const MachineFunction *MF) override |
| Gather pre-function debug information. | |
| void | endFunction (const MachineFunction *MF) override |
| Gather post-function debug information. | |
| void | beginBasicBlockSection (const MachineBasicBlock &MBB) override |
| Process the beginning of a new basic-block-section within a function. | |
| void | endBasicBlockSection (const MachineBasicBlock &MBB) override |
| Process the end of a basic-block-section within a function. | |
| MCSymbol * | getLabelBeforeInsn (const MachineInstr *MI) |
| Return Label preceding the instruction. | |
| MCSymbol * | getLabelAfterInsn (const MachineInstr *MI) |
| Return Label immediately following the instruction. | |
| const InstructionOrdering & | getInstOrdering () const |
| const LexicalScopes & | getLexicalScopes () const |
| Public Member Functions inherited from llvm::AsmPrinterHandler | |
| virtual | ~AsmPrinterHandler () |
| Pin vtables to this file. | |
| virtual void | markFunctionEnd () |
| virtual void | setSymbolSize (const MCSymbol *Sym, uint64_t Size) |
| For symbols that have a size designated (e.g. | |
| virtual void | beginCodeAlignment (const MachineBasicBlock &MBB) |
| virtual void | beginFunclet (const MachineBasicBlock &MBB, MCSymbol *Sym=nullptr) |
| Emit target-specific EH funclet machinery. | |
| virtual void | endFunclet () |
Protected Member Functions | |
| void | endModule () override |
| Emit all sections that should come after the content. | |
| void | beginInstruction (const MachineInstr *MI) override |
| Process beginning of an instruction. | |
| void | endInstruction () override |
| Process end of an instruction. | |
| void | beginFunctionImpl (const MachineFunction *MF) override |
| void | endFunctionImpl (const MachineFunction *MF) override |
| Protected Member Functions inherited from llvm::DebugHandlerBase | |
| DebugHandlerBase (AsmPrinter *A) | |
| void | identifyScopeMarkers () |
| Indentify instructions that are marking the beginning of or ending of a scope. | |
| void | requestLabelBeforeInsn (const MachineInstr *MI) |
| Ensure that a label will be emitted before MI. | |
| void | requestLabelAfterInsn (const MachineInstr *MI) |
| Ensure that a label will be emitted after MI. | |
| virtual void | skippedNonDebugFunction () |
Additional Inherited Members | |
| Static Public Member Functions inherited from llvm::DebugHandlerBase | |
| static uint64_t | getBaseTypeSize (const DIType *Ty) |
| If this type is derived from a base type then return base type size. | |
| static bool | isUnsignedDIType (const DIType *Ty) |
| Return true if type encoding is unsigned. | |
| Protected Attributes inherited from llvm::DebugHandlerBase | |
| AsmPrinter * | Asm = nullptr |
| Target of debug info emission. | |
| MachineModuleInfo * | MMI = nullptr |
| Collected machine module information. | |
| DebugLoc | PrevInstLoc |
| Previous instruction's location information. | |
| MCSymbol * | PrevLabel = nullptr |
| const MachineBasicBlock * | PrevInstBB = nullptr |
| const MachineInstr * | PrologEndLoc |
| This location indicates end of function prologue and beginning of function body. | |
| const MachineBasicBlock * | EpilogBeginBlock = nullptr |
| This block includes epilogue instructions. | |
| const MachineInstr * | CurMI = nullptr |
| If nonnull, stores the current machine instruction we're processing. | |
| LexicalScopes | LScopes |
| DbgValueHistoryMap | DbgValues |
| History of DBG_VALUE and clobber instructions for each user variable. | |
| DbgLabelInstrMap | DbgLabels |
| Mapping of inlined labels and DBG_LABEL machine instruction. | |
| DenseMap< const MachineInstr *, MCSymbol * > | LabelsBeforeInsn |
| Maps instruction with label emitted before instruction. | |
| DenseMap< const MachineInstr *, MCSymbol * > | LabelsAfterInsn |
| Maps instruction with label emitted after instruction. | |
AsmPrinter handler that emits NonSemantic.Shader.DebugInfo.100 (NSDI) instructions for the SPIR-V backend.
Registered with SPIRVAsmPrinter when the module contains debug info (llvm.dbg.cu).
Call sequence: beginModule() – collect compile-unit metadata. prepareModuleOutput() – add extension + ext inst set to MAI. emitNonSemanticGlobalDebugInfo() – emit DebugSource, DebugCompilationUnit, DebugTypeBasic, DebugTypePointer. beginFunctionImpl() – no-op (no per-function DI yet). endFunctionImpl() – no-op.
Definition at line 48 of file SPIRVNonSemanticDebugHandler.h.
|
explicit |
Definition at line 26 of file SPIRVNonSemanticDebugHandler.cpp.
References llvm::DebugHandlerBase::DebugHandlerBase().
|
inlineoverrideprotectedvirtual |
Implements llvm::DebugHandlerBase.
Definition at line 133 of file SPIRVNonSemanticDebugHandler.h.
|
inlineoverrideprotectedvirtual |
Process beginning of an instruction.
Reimplemented from llvm::DebugHandlerBase.
Definition at line 126 of file SPIRVNonSemanticDebugHandler.h.
References MI.
|
overridevirtual |
Collect compile-unit metadata from the module.
Called by AsmPrinter::doInitialization() via the handler list. No emission.
Reimplemented from llvm::DebugHandlerBase.
Definition at line 53 of file SPIRVNonSemanticDebugHandler.cpp.
References llvm::sys::path::append(), llvm::DebugHandlerBase::Asm, llvm::DebugHandlerBase::beginModule(), llvm::cast(), llvm::dyn_cast(), llvm::dyn_cast_or_null(), llvm::MDOperand::equalsStr(), F, llvm::filterDbgVars(), I, and llvm::sys::path::is_absolute().
| void SPIRVNonSemanticDebugHandler::emitNonSemanticDebugStrings | ( | SPIRV::ModuleAnalysisInfo & | MAI | ) |
Emit OpString instructions for all NSDI file paths and basic type names into the debug section (section 7 of the SPIR-V module layout).
Must be called from SPIRVAsmPrinter::outputDebugSourceAndStrings(), after prepareModuleOutput() has registered the ext inst set. The resulting registers are cached in FileStringRegs and BasicTypeNameRegs for use by emitNonSemanticGlobalDebugInfo().
Definition at line 248 of file SPIRVNonSemanticDebugHandler.cpp.
References llvm::SPIRV::ModuleAnalysisInfo::getExtInstSetReg(), and llvm::MCRegister::isValid().
| void SPIRVNonSemanticDebugHandler::emitNonSemanticGlobalDebugInfo | ( | SPIRV::ModuleAnalysisInfo & | MAI | ) |
Emit module-scope NSDI instructions (DebugSource, DebugCompilationUnit, DebugTypeBasic, DebugTypePointer).
Called by SPIRVAsmPrinter:: outputModuleSections() at section 10 in place of outputModuleSection(MB_NonSemanticGlobalDI).
Definition at line 267 of file SPIRVNonSemanticDebugHandler.cpp.
References assert(), llvm::SPIRV::ModuleAnalysisInfo::getExtInstSetReg(), llvm::MCRegister::isValid(), llvm::map_to_vector(), and llvm::zip().
|
inlineoverrideprotectedvirtual |
Implements llvm::DebugHandlerBase.
Definition at line 135 of file SPIRVNonSemanticDebugHandler.h.
|
inlineoverrideprotectedvirtual |
Process end of an instruction.
Reimplemented from llvm::DebugHandlerBase.
Definition at line 127 of file SPIRVNonSemanticDebugHandler.h.
|
inlineoverrideprotectedvirtual |
Emit all sections that should come after the content.
Implements llvm::AsmPrinterHandler.
Definition at line 116 of file SPIRVNonSemanticDebugHandler.h.
| void SPIRVNonSemanticDebugHandler::prepareModuleOutput | ( | const SPIRVSubtarget & | ST, |
| SPIRV::ModuleAnalysisInfo & | MAI ) |
Add SPV_KHR_non_semantic_info extension and NonSemantic.Shader.DebugInfo.100 ext inst set entry to MAI.
Must be called before outputGlobalRequirements() and outputOpExtInstImports() in SPIRVAsmPrinter::outputModuleSections().
Definition at line 113 of file SPIRVNonSemanticDebugHandler.cpp.
References llvm::SPIRV::RequirementHandler::addExtension(), llvm::SPIRV::ModuleAnalysisInfo::ExtInstSetMap, llvm::SPIRV::ModuleAnalysisInfo::getNextIDRegister(), and llvm::SPIRV::ModuleAnalysisInfo::Reqs.