Skip to content

Commit dacd7d0

Browse files
[Backport to 15][DebugInfo] Fix EnumClass support (#2876) (#2941)
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 3b793ef commit dacd7d0

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
@@ -493,6 +493,8 @@ SPIRVWord LLVMToSPIRVDbgTran::mapDebugFlags(DINode::DIFlags DFlags) {
493493
if (BM->getDebugInfoEIS() == SPIRVEIS_NonSemantic_Shader_DebugInfo_200)
494494
if (DFlags & DINode::FlagBitField)
495495
Flags |= SPIRVDebug::FlagBitField;
496+
if (DFlags & DINode::FlagEnumClass)
497+
Flags |= SPIRVDebug::FlagIsEnumClass;
496498
return Flags;
497499
}
498500

lib/SPIRV/SPIRVToLLVMDbgTran.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ DINode *SPIRVToLLVMDbgTran::transTypeEnum(const SPIRVExtInst *DebugInst) {
812812
UnderlyingType = transDebugInst<DIType>(static_cast<SPIRVExtInst *>(E));
813813
return getDIBuilder(DebugInst).createEnumerationType(
814814
Scope, Name, File, LineNo, SizeInBits, AlignInBits, Enumerators,
815-
UnderlyingType, "", UnderlyingType);
815+
UnderlyingType, "", Flags & SPIRVDebug::FlagIsEnumClass);
816816
}
817817
}
818818

0 commit comments

Comments
 (0)