[llvm] [SPIRV] Emit NonSemantic DebugTypeComposite and DebugTypeMember. (PR #211638)
Manuel Carrasco via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 24 04:42:31 PDT 2026
================
@@ -891,6 +1027,25 @@ void SPIRVNonSemanticDebugHandler::emitNonSemanticGlobalDebugInfo(
DebugFunctionDeclarationRegs[SP] = *DeclReg;
}
+ // Emit DebugTypeMember and DebugTypeComposite for each struct, class, or
+ // union. Each member is emitted before the composite that lists it, so the
+ // Members operand references already-defined ids. A member whose type is not
+ // in DebugTypeRegs is skipped.
+ for (const DICompositeType *CT : CompositeTypes) {
+ SmallVector<MCRegister> MemberRegs;
+ for (const DINode *Element : CT->getElements()) {
+ const auto *M = dyn_cast<DIDerivedType>(Element);
+ if (!M || M->getTag() != dwarf::DW_TAG_member)
+ continue;
+ if (auto MemberReg = emitDebugTypeMember(M, VoidTypeReg, I32TypeReg,
----------------
mgcarrasco wrote:
Could it leave the `Size` operand inconsistent (relative to its members' sizes)?
https://github.com/llvm/llvm-project/pull/211638
More information about the llvm-commits
mailing list