Skip to content

Commit

Permalink
[Backport to 17][DebugInfo] Fix EnumClass support (KhronosGroup#2876)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matborzyszkowski committed Dec 17, 2024
1 parent 17092f0 commit 49788de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/SPIRV/LLVMToSPIRVDbgTran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ SPIRVWord LLVMToSPIRVDbgTran::mapDebugFlags(DINode::DIFlags DFlags) {
if (BM->getDebugInfoEIS() == SPIRVEIS_NonSemantic_Shader_DebugInfo_200)
if (DFlags & DINode::FlagBitField)
Flags |= SPIRVDebug::FlagBitField;
if (DFlags & DINode::FlagEnumClass)
Flags |= SPIRVDebug::FlagIsEnumClass;
return Flags;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/SPIRV/SPIRVToLLVMDbgTran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ DINode *SPIRVToLLVMDbgTran::transTypeEnum(const SPIRVExtInst *DebugInst) {
UnderlyingType = transDebugInst<DIType>(static_cast<SPIRVExtInst *>(E));
return getDIBuilder(DebugInst).createEnumerationType(
Scope, Name, File, LineNo, SizeInBits, AlignInBits, Enumerators,
UnderlyingType, "", UnderlyingType);
UnderlyingType, 0, "", Flags & SPIRVDebug::FlagIsEnumClass);
}
}

Expand Down

0 comments on commit 49788de

Please sign in to comment.