[llvm] [SPIRV] Emit NonSemantic DebugGlobalVariable (PR #207230)
Manuel Carrasco via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 10 06:46:37 PDT 2026
================
@@ -561,6 +586,90 @@ std::optional<MCRegister> SPIRVNonSemanticDebugHandler::mapDISignatureTypeToReg(
return lookupOptReg(DebugTypeRegs, Ty);
}
+std::optional<MCRegister>
+SPIRVNonSemanticDebugHandler::resolveGlobalVariableParent(
+ const DIGlobalVariable *GV) const {
+ // TODO: When this backend emits debug instructions for namespace, subprogram,
+ // and module scopes, return GV->getScope()'s debug id.
+
+ // Fallback: first module compile unit (SPIRV-LLVM-Translator default).
----------------
mgcarrasco wrote:
The TODO and the fallback are orthogonal because a DIGlobalVariable GV can return null for `GV->getScope()` (valid IR). When the TODO is implemented, this edge case must still be handled.
https://github.com/llvm/llvm-project/pull/207230
More information about the llvm-commits
mailing list