From: Dmitry Sidorov Date: Tue, 25 Apr 2023 20:17:50 +0000 (+0200) Subject: [PATCH 38/79] [DebugInfo] Fix Composite type translation for NonSemantic spec (#1975) X-Git-Tag: archive/raspbian/15.0.0-6+rpi1^2~43 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fc87817ab79455c92579f00cd0d32f72b1aafea5;p=spirv-llvm-translator-15.git [PATCH 38/79] [DebugInfo] Fix Composite type translation for NonSemantic spec (#1975) Tag should be OpConstant, not Literal. Signed-off-by: Sidorov, Dmitry Gbp-Pq: Name 0038-DebugInfo-Fix-Composite-type-translation-for-NonSema.patch --- diff --git a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp index 49f1cfb..ee6b668 100644 --- a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp +++ b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp @@ -931,7 +931,7 @@ LLVMToSPIRVDbgTran::transDbgCompositeType(const DICompositeType *CT) { } if (isNonSemanticDebugInfo()) - transformToConstant(Ops, {LineIdx, ColumnIdx, FlagsIdx}); + transformToConstant(Ops, {TagIdx, LineIdx, ColumnIdx, FlagsIdx}); SPIRVEntry *Res = BM->addDebugInfo(SPIRVDebug::TypeComposite, getVoidTy(), Ops); diff --git a/test/DebugInfo/TransTypeCompositeCaseClass_.ll b/test/DebugInfo/TransTypeCompositeCaseClass_.ll index 1b06cef..3dcea44 100644 --- a/test/DebugInfo/TransTypeCompositeCaseClass_.ll +++ b/test/DebugInfo/TransTypeCompositeCaseClass_.ll @@ -13,6 +13,10 @@ ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc ; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM +; RUN: llvm-spirv --spirv-debug-info-version=nonsemantic-shader-100 %t.bc -o %t.spv +; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc +; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM + ; ModuleID = 'main.cpp' source_filename = "main.cpp" target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"