File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1310,13 +1310,14 @@ SPIRVEntry *LLVMToSPIRVDbgTran::transDbgFunction(const DISubprogram *Func) {
13101310 if (DISubprogram *FuncDecl = Func->getDeclaration ())
13111311 Ops.push_back (transDbgEntry (FuncDecl)->getId ());
13121312 else {
1313- Ops.push_back (getDebugInfoNoneId ());
13141313 if (BM->getDebugInfoEIS () == SPIRVEIS_NonSemantic_Shader_DebugInfo_200) {
13151314 // Translate targetFuncName mostly for Fortran trampoline function if it
13161315 // is the case
13171316 StringRef TargetFunc = Func->getTargetFuncName ();
1318- if (!TargetFunc.empty ())
1317+ if (!TargetFunc.empty ()) {
1318+ Ops.push_back (getDebugInfoNoneId ());
13191319 Ops.push_back (BM->getString (TargetFunc.str ())->getId ());
1320+ }
13201321 }
13211322 }
13221323
Original file line number Diff line number Diff line change 55// even if in LLVM IR it points to a DIFile instead of DICompileUnit.
66
77// RUN: %clang_cc1 %s -cl-std=clc++ -emit-llvm-bc -triple spir -debug-info-kind=line-tables-only -O0 -o - | llvm-spirv -o %t.spv
8+ // RUN: spirv-val %t.spv
89// RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
910// RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK-LLVM
1011
@@ -18,8 +19,8 @@ void kernel k() {
1819// CHECK-SPIRV: String [[foo:[0-9]+]] "foo"
1920// CHECK-SPIRV: String [[k:[0-9]+]] "k"
2021// CHECK-SPIRV: [[CU:[0-9]+]] {{[0-9]+}} DebugCompilationUnit
21- // CHECK-SPIRV: DebugFunction [[foo]] {{.*}} [[CU]] {{.*}} [[foo_id:[0-9]+]] {{[0-9]+}} {{ $}}
22- // CHECK-SPIRV: DebugFunction [[k]] {{.*}} [[CU]] {{.*}} [[k_id:[0-9]+]] {{[0-9]+}} {{ $}}
22+ // CHECK-SPIRV: DebugFunction [[foo]] {{.*}} [[CU]] {{.*}} [[foo_id:[0-9]+]] {{$}}
23+ // CHECK-SPIRV: DebugFunction [[k]] {{.*}} [[CU]] {{.*}} [[k_id:[0-9]+]] {{$}}
2324
2425// CHECK-SPIRV: Function {{[0-9]+}} [[foo_id]]
2526// CHECK-LLVM: define spir_func float @_Z3fooi(i32 %i) #{{[0-9]+}} !dbg !{{[0-9]+}} {
You can’t perform that action at this time.
0 commit comments