Skip to content

Commit 52e2924

Browse files
bwlodarczjsji
authored andcommitted
Fix EnumClass support (#2876)
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. Original commit: KhronosGroup/SPIRV-LLVM-Translator@50af2c70832745b
1 parent b40ea1c commit 52e2924

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

llvm-spirv/lib/SPIRV/LLVMToSPIRVDbgTran.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@ SPIRVWord LLVMToSPIRVDbgTran::mapDebugFlags(DINode::DIFlags DFlags) {
500500
if (BM->getDebugInfoEIS() == SPIRVEIS_NonSemantic_Shader_DebugInfo_200)
501501
if (DFlags & DINode::FlagBitField)
502502
Flags |= SPIRVDebug::FlagBitField;
503+
if (DFlags & DINode::FlagEnumClass)
504+
Flags |= SPIRVDebug::FlagIsEnumClass;
503505
return Flags;
504506
}
505507

llvm-spirv/lib/SPIRV/SPIRVToLLVMDbgTran.cpp

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

0 commit comments

Comments
 (0)