summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
diff options
context:
space:
mode:
authorShiva Chen <shiva0217@gmail.com>2018-05-09 02:40:45 +0000
committerShiva Chen <shiva0217@gmail.com>2018-05-09 02:40:45 +0000
commit2c864551df3945f50e1780b2f2c880ec358ae715 (patch)
treed82705cf2fd8d7508726df36d2034176d901c2f2 /llvm/test/Bitcode
parent49914cc807a933f3bafd61b88248e75a90101333 (diff)
downloadbcm5719-llvm-2c864551df3945f50e1780b2f2c880ec358ae715.tar.gz
bcm5719-llvm-2c864551df3945f50e1780b2f2c880ec358ae715.zip
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around labels, we need collect debug information for labels, i.e., label name, the function label belong, line number in the file, and the address label located. In order to keep these information in LLVM IR and to allow backend to generate debug information correctly. We create a new kind of metadata for labels, DILabel. The format of DILabel is !DILabel(scope: !1, name: "foo", file: !2, line: 3) We hope to keep debug information as much as possible even the code is optimized. So, we create a new kind of intrinsic for label metadata to avoid the metadata is eliminated with basic block. The intrinsic will keep existing if we keep it from optimized out. The format of the intrinsic is llvm.dbg.label(metadata !1) It has only one argument, that is the DILabel metadata. The intrinsic will follow the label immediately. Backend could get the label metadata through the intrinsic's parameter. We also create DIBuilder API for labels to be used by Frontend. Frontend could use createLabel() to allocate DILabel objects, and use insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR. Differential Revision: https://reviews.llvm.org/D45024 Patch by Hsiangkai Wang. llvm-svn: 331841
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r--llvm/test/Bitcode/DILocalVariable-explicit-tags.ll4
-rw-r--r--llvm/test/Bitcode/dilocalvariable-3.9.ll2
-rw-r--r--llvm/test/Bitcode/disubrange-v0.ll2
-rw-r--r--llvm/test/Bitcode/disubrange.ll2
-rw-r--r--llvm/test/Bitcode/upgrade-dbg-value.ll2
-rw-r--r--llvm/test/Bitcode/upgrade-subprogram-this.ll2
6 files changed, 7 insertions, 7 deletions
diff --git a/llvm/test/Bitcode/DILocalVariable-explicit-tags.ll b/llvm/test/Bitcode/DILocalVariable-explicit-tags.ll
index b3e793d4cb4..a42884cc427 100644
--- a/llvm/test/Bitcode/DILocalVariable-explicit-tags.ll
+++ b/llvm/test/Bitcode/DILocalVariable-explicit-tags.ll
@@ -3,7 +3,7 @@
;
; RUN: llvm-dis < %s.bc -o - | llvm-as | llvm-dis | FileCheck %s
-; CHECK: ![[SP:[0-9]+]] = distinct !DISubprogram(name: "foo",{{.*}} variables: ![[VARS:[0-9]+]]
+; CHECK: ![[SP:[0-9]+]] = distinct !DISubprogram(name: "foo",{{.*}} retainedNodes: ![[VARS:[0-9]+]]
; CHECK: ![[VARS]] = !{![[PARAM:[0-9]+]], ![[AUTO:[0-9]+]]}
; CHECK: ![[PARAM]] = !DILocalVariable(name: "param", arg: 1, scope: ![[SP]])
; CHECK: ![[AUTO]] = !DILocalVariable(name: "auto", scope: ![[SP]])
@@ -13,7 +13,7 @@
!llvm.module.flags = !{!6}
!llvm.dbg.cu = !{!4}
-!0 = distinct !DISubprogram(name: "foo", scope: null, isLocal: false, isDefinition: true, isOptimized: false, variables: !1)
+!0 = distinct !DISubprogram(name: "foo", scope: null, isLocal: false, isDefinition: true, isOptimized: false, retainedNodes: !1)
!1 = !{!2, !3}
!2 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "param", arg: 1, scope: !0)
!3 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "auto", scope: !0)
diff --git a/llvm/test/Bitcode/dilocalvariable-3.9.ll b/llvm/test/Bitcode/dilocalvariable-3.9.ll
index 2e39a2f5242..99f99db0637 100644
--- a/llvm/test/Bitcode/dilocalvariable-3.9.ll
+++ b/llvm/test/Bitcode/dilocalvariable-3.9.ll
@@ -13,7 +13,7 @@
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{!"clang version 3.9.1 (http://llvm.org/git/clang.git c3709e72d22432f53f8e2f14354def31a96734fe)"}
-!6 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, variables: !2)
+!6 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2)
!7 = !DISubroutineType(types: !8)
!8 = !{null}
!9 = !DILocalVariable(name: "i", scope: !6, file: !1, line: 1, type: !10)
diff --git a/llvm/test/Bitcode/disubrange-v0.ll b/llvm/test/Bitcode/disubrange-v0.ll
index 2d4cd187144..c50d406c59b 100644
--- a/llvm/test/Bitcode/disubrange-v0.ll
+++ b/llvm/test/Bitcode/disubrange-v0.ll
@@ -22,7 +22,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"wchar_size", i32 4}
!6 = !{!"clang version 5.0.1"}
-!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 20, type: !8, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !11)
+!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 20, type: !8, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !11)
!8 = !DISubroutineType(types: !9)
!9 = !{null, !10}
!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
diff --git a/llvm/test/Bitcode/disubrange.ll b/llvm/test/Bitcode/disubrange.ll
index 5c725099ae3..b41257ef4bd 100644
--- a/llvm/test/Bitcode/disubrange.ll
+++ b/llvm/test/Bitcode/disubrange.ll
@@ -23,7 +23,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"wchar_size", i32 4}
!6 = !{!"clang version 5.0.1"}
-!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 20, type: !8, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !11)
+!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 20, type: !8, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !11)
!8 = !DISubroutineType(types: !9)
!9 = !{null, !10}
!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
diff --git a/llvm/test/Bitcode/upgrade-dbg-value.ll b/llvm/test/Bitcode/upgrade-dbg-value.ll
index 2a3a6369ae8..6e29e6f76b6 100644
--- a/llvm/test/Bitcode/upgrade-dbg-value.ll
+++ b/llvm/test/Bitcode/upgrade-dbg-value.ll
@@ -22,7 +22,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llc r309174", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
!1 = !DIFile(filename: "a.c", directory: "/")
!2 = !{i32 1, !"Debug Info Version", i32 3}
-!3 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !4, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, variables: !7)
+!3 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !4, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, retainedNodes: !7)
!4 = !DISubroutineType(types: !5)
!5 = !{!6}
!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
diff --git a/llvm/test/Bitcode/upgrade-subprogram-this.ll b/llvm/test/Bitcode/upgrade-subprogram-this.ll
index d84aa0aad44..81da5b06221 100644
--- a/llvm/test/Bitcode/upgrade-subprogram-this.ll
+++ b/llvm/test/Bitcode/upgrade-subprogram-this.ll
@@ -24,7 +24,7 @@ entry:
!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
!2 = !{}
!4 = !{i32 2, !"Debug Info Version", i32 3}
-!7 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
+!7 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
!8 = !DISubroutineType(types: !9)
!9 = !{null}
!10 = !DILocation(line: 1, column: 11, scope: !7)
OpenPOWER on IntegriCloud