[PATCH 38/79] [DebugInfo] Fix Composite type translation for NonSemantic spec (#1975)
authorDmitry Sidorov <dmitry.sidorov@intel.com>
Tue, 25 Apr 2023 20:17:50 +0000 (22:17 +0200)
committerAndreas Beckmann <anbe@debian.org>
Thu, 14 Mar 2024 19:01:08 +0000 (20:01 +0100)
Tag should be OpConstant, not Literal.

Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
Gbp-Pq: Name 0038-DebugInfo-Fix-Composite-type-translation-for-NonSema.patch

lib/SPIRV/LLVMToSPIRVDbgTran.cpp
test/DebugInfo/TransTypeCompositeCaseClass_.ll

index 49f1cfba3611e34e22811e375348c3316d0f773d..ee6b66876ee6b70976e46e0f3afad047c9804b8a 100644 (file)
@@ -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);
 
index 1b06cef4e54f934b2807718499622d0de29da8d7..3dcea4455bf4cb4fc616b6313b570725e49d2e53 100644 (file)
 ; 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"