[PATCH] D96409: [debug-info] refactor emitDwarfUnitLength

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 07:44:24 PST 2021


ikudrin added inline comments.


================
Comment at: llvm/test/DebugInfo/X86/addr_comments.ll:4-5
 ; CHECK:   .section .debug_addr
-; CHECK-NEXT:   .long   .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
-; CHECK-NEXT: .Ldebug_addr_start0:
+; CHECK-NEXT:   .long   .Ldebug_addr_end0-.Ltmp3 # Length of contribution
+; CHECK-NEXT: .Ltmp3:
 ; CHECK-NEXT:   .short  5 # DWARF version number
----------------
It is better to avoid checking specific names of temporary labels. They may change with changes in other parts, which makes the test fragile. What about using substitutions instead?


================
Comment at: llvm/test/DebugInfo/X86/dwarf-pubnames-split.ll:10
 
-; CHECK: .LpubTypes_begin0:
+; CHECK: .Ltmp5:
 ; CHECK-NEXT: .short    2                       # DWARF Version
----------------
This label now does not identify the section well and also makes the test fragile. How about this:
```
; CHECK:      .section .debug_pubtypes
; CHECK-NEXT: .long
; CHECK-NEXT: .Ltmp{{.+}}:
...
```


================
Comment at: llvm/test/DebugInfo/X86/length_symbol_difference.ll:3-4
 
-; CHECK:      .long   .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
-; CHECK-NEXT: .Ldebug_info_start0:
+; CHECK:      .long   .Ldebug_info_end0-.Ltmp1 # Length of Unit
+; CHECK-NEXT: .Ltmp1:
 ; CHECK-NOT:  .byte   0
----------------
Ditto.


================
Comment at: llvm/test/MC/WebAssembly/comdat-sections.ll:20-21
 ; that the section contains a type unit for a type with matching signature
-; ASM-NEXT:	.int32	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
-; ASM-NEXT: .Ldebug_info_start0:
+; ASM-NEXT:	.int32	.Ldebug_info_end0-.Ltmp0 # Length of Unit
+; ASM-NEXT: .Ltmp0:
 ; ASM-NEXT:	.int16	4                               # DWARF version number
----------------
The same.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96409/new/

https://reviews.llvm.org/D96409



More information about the llvm-commits mailing list