mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-08 13:00:43 +00:00
5420de3f15
This patch reverses the edge from DIGlobalVariable to GlobalVariable. This will allow us to more easily preserve debug info metadata when manipulating global variables. Fixes PR30362. A program for upgrading test cases is attached to that bug. Differential Revision: http://reviews.llvm.org/D20147 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281284 91177308-0d34-0410-b5e6-96231b3b80d8
32 lines
1.5 KiB
LLVM
32 lines
1.5 KiB
LLVM
; RUN: opt -strip-debug < %s -S | FileCheck %s
|
|
|
|
; CHECK-NOT: call void @llvm.dbg.value
|
|
|
|
@x = common global i32 0, !dbg !8 ; <i32*> [#uses=0]
|
|
|
|
define void @foo() nounwind readnone optsize ssp !dbg !0 {
|
|
entry:
|
|
tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !5, metadata !{}), !dbg !10
|
|
ret void, !dbg !11
|
|
}
|
|
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
|
|
|
|
!llvm.module.flags = !{!13}
|
|
!llvm.dbg.cu = !{!2}
|
|
|
|
!0 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2, file: !12, scope: !1, type: !3)
|
|
!1 = !DIFile(filename: "b.c", directory: "/tmp")
|
|
!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: FullDebug, file: !12, globals: !{!8})
|
|
!3 = !DISubroutineType(types: !4)
|
|
!4 = !{null}
|
|
!5 = !DILocalVariable(name: "y", line: 3, scope: !6, file: !1, type: !7)
|
|
!6 = distinct !DILexicalBlock(line: 2, column: 0, file: !12, scope: !0)
|
|
!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
!8 = !DIGlobalVariable(name: "x", line: 1, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !7)
|
|
!9 = !{i32 0}
|
|
!10 = !DILocation(line: 3, scope: !6)
|
|
!11 = !DILocation(line: 4, scope: !6)
|
|
!12 = !DIFile(filename: "b.c", directory: "/tmp")
|
|
!13 = !{i32 1, !"Debug Info Version", i32 3}
|