Skip to content

Commit 9e0d675

Browse files
[Backport to 17][DebugInfo] Fix EnumClass support (#2876) (#2939)
This commit addresses issues with EnumClass handling in DebugEnumType. In reverse translation, a bug caused the EnumClass flag to be incorrectly applied to every DebugEnumType with an UnderlyingType. Additionally, in forward translation, the support for EnumClassFlag was missing entirely.
1 parent f777d30 commit 9e0d675

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/SPIRV/LLVMToSPIRVDbgTran.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ SPIRVWord LLVMToSPIRVDbgTran::mapDebugFlags(DINode::DIFlags DFlags) {
495495
if (BM->getDebugInfoEIS() == SPIRVEIS_NonSemantic_Shader_DebugInfo_200)
496496
if (DFlags & DINode::FlagBitField)
497497
Flags |= SPIRVDebug::FlagBitField;
498+
if (DFlags & DINode::FlagEnumClass)
499+
Flags |= SPIRVDebug::FlagIsEnumClass;
498500
return Flags;
499501
}
500502

lib/SPIRV/SPIRVToLLVMDbgTran.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ DINode *SPIRVToLLVMDbgTran::transTypeEnum(const SPIRVExtInst *DebugInst) {
799799
UnderlyingType = transDebugInst<DIType>(static_cast<SPIRVExtInst *>(E));
800800
return getDIBuilder(DebugInst).createEnumerationType(
801801
Scope, Name, File, LineNo, SizeInBits, AlignInBits, Enumerators,
802-
UnderlyingType, "", UnderlyingType);
802+
UnderlyingType, "", Flags & SPIRVDebug::FlagIsEnumClass);
803803
}
804804
}
805805

0 commit comments

Comments
 (0)