Issue 131512
Summary debugline llvmir is different from dwarfdump
Labels
Assignees
Reporter Guo-yyds
    I am doing a strange project, I don't have the ast to join the line number information inside, then I am xxir (my own definition of intermediate code format) turn llvmir use 
```c
LLVMInstructionSetDebugLoc (r, loc); 
```
Added line number information, but now there is a problem, llvmir and dwarfdump line number information is different, dwarfdump line number information has a part of 0 line


```
attributes #0 = { "frame-pointer"="all" "frame-reserved-slots"="16" }
attributes #1 = { nocallback nofree nosync nounwind readnone willreturn }
attributes #2 = { nounwind readonly }
attributes #3 = { cold }

!llvm.dbg.cu = !{!0}

!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "ArkCompiler", isOptimized: false, flags: "-O0 -g", runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, sysroot: "/")
!1 = !DIFile(filename: "hello-world.ts", directory: "/home/guo/ark")
!2 = distinct !DISubprogram(name: "func_mai...@hello-world.ts@4...@hello-world.abc", linkageName: "func_mai...@hello-world.ts@4...@hello-world.abc", scope: !1, file: !1, line: 1, type: !3, scopeLine: 2, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !0, retainedNodes: !4)
!3 = !DISubroutineType(types: !4)
!4 = !{}
!5 = !{!"rsp\00"}
!6 = !DILocation(line: 7, scope: !2)
!7 = !DILocation(line: 7, column: 10, scope: !2)
!8 = distinct !DISubprogram(name: "#*#f...@hello-world.ts@3...@hello-world.abc", linkageName: "#*#f...@hello-world.ts@3...@hello-world.abc", scope: !1, file: !1, line: 3, type: !3, scopeLine: 4, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !0, retainedNodes: !4)
!9 = !DILocation(line: 4, column: 2, scope: !8)
!10 = !DILocation(line: 4, column: 8, scope: !8)
```

```
Address Line   Column File   ISA Discriminator OpIndex Flags
------------------ ------ ------ ------ --- ------------- ------- -------------
0x00007f1585a69000      1      0      1   0             0 0  is_stmt
0x00007f1585a69105      7      0      1   0             0 0  is_stmt prologue_end
0x00007f1585a69115      0      0      1   0 0       0 
0x00007f1585a69144      7     10      1   0             0 0 
0x00007f1585a69154      0     10      1   0             0       0 
0x00007f1585a69580      1      0      1   0             0       0 is_stmt
0x00007f1585a69644      4      2      1   0             0       0 is_stmt prologue_end
0x00007f1585a69654      0      2      1   0 0       0 
0x00007f1585a69914      0      2      1   0             0       0 end_sequence
```

![Image](https://github.com/user-attachments/assets/cc5061e9-20b8-4287-8651-e277be5d7b3a)

What could be the reason for this?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to