mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
Summary: Based on Fred's patch here: https://reviews.llvm.org/D6771 I can't seem to commandeer the old review, so I'm creating a new one. With that change the locations exrpessions are pretty printed inline in the DIE tree. The output looks like this for debug_loc entries: DW_AT_location [DW_FORM_data4] (0x00000000 0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3 0x000000000000000b - 0x0000000000000012: DW_OP_consts +7 0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4 0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0) And like this for debug_loc.dwo entries: DW_AT_location [DW_FORM_sec_offset] (0x00000000 Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4) Simple locations without ranges are printed inline: DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0) The debug_loc(.dwo) dumping in changed accordingly to factor the code. Reviewers: dblaikie, aprantl, friss Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D37123 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312042 91177308-0d34-0410-b5e6-96231b3b80d8
56 lines
2.5 KiB
LLVM
56 lines
2.5 KiB
LLVM
; RUN: %llc_dwarf -O0 -filetype=obj -o %t.o %s
|
|
; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
|
|
; REQUIRES: object-emission
|
|
target datalayout = "e-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
|
|
target triple = "thumbv7-apple-unknown-macho"
|
|
|
|
; generated from (-triple thumbv7-apple-unknown-macho -Os):
|
|
; void f(_Complex double c) { c = 0; }
|
|
|
|
; Function Attrs: nounwind readnone
|
|
define arm_aapcscc void @f([2 x i64] %c.coerce) #0 !dbg !4 {
|
|
entry:
|
|
tail call void @llvm.dbg.declare(metadata { double, double }* undef, metadata !14, metadata !15), !dbg !16
|
|
; The target has no native double type.
|
|
; SROA split the complex value into two i64 values.
|
|
; CHECK: DW_TAG_formal_parameter
|
|
; CHECK-NEXT: DW_AT_location [DW_FORM_block1] (DW_OP_constu 0x0, DW_OP_piece 0x8)
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "c"
|
|
tail call void @llvm.dbg.value(metadata i64 0, metadata !14, metadata !17), !dbg !16
|
|
; Manually removed to disable location list emission:
|
|
; tail call void @llvm.dbg.value(metadata i64 0, metadata !14, metadata !18), !dbg !16
|
|
ret void, !dbg !19
|
|
}
|
|
|
|
; Function Attrs: nounwind readnone
|
|
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
|
|
|
|
; Function Attrs: nounwind readnone
|
|
declare void @llvm.dbg.value(metadata, metadata, metadata) #0
|
|
|
|
attributes #0 = { nounwind readnone }
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
!llvm.module.flags = !{!9, !10, !11, !12}
|
|
!llvm.ident = !{!13}
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 259998) (llvm/trunk 259999)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
|
|
!1 = !DIFile(filename: "<stdin>", directory: "/")
|
|
!2 = !{}
|
|
!4 = distinct !DISubprogram(name: "f", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
|
|
!5 = !DIFile(filename: "test.c", directory: "/")
|
|
!6 = !DISubroutineType(types: !7)
|
|
!7 = !{null, !8}
|
|
!8 = !DIBasicType(name: "complex", size: 128, align: 64, encoding: DW_ATE_complex_float)
|
|
!9 = !{i32 2, !"Dwarf Version", i32 2}
|
|
!10 = !{i32 2, !"Debug Info Version", i32 3}
|
|
!11 = !{i32 1, !"wchar_size", i32 4}
|
|
!12 = !{i32 1, !"min_enum_size", i32 4}
|
|
!13 = !{!"clang version 3.9.0 (trunk 259998) (llvm/trunk 259999)"}
|
|
!14 = !DILocalVariable(name: "c", arg: 1, scope: !4, file: !5, line: 1, type: !8)
|
|
!15 = !DIExpression()
|
|
!16 = !DILocation(line: 1, column: 24, scope: !4)
|
|
!17 = !DIExpression(DW_OP_LLVM_fragment, 0, 64)
|
|
!18 = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
|
|
!19 = !DILocation(line: 1, column: 36, scope: !4)
|