[PATCH] D77343: Teach the stripNonLineTableDebugInfo pass about the llvm.dbg.addr intrinsic.
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 2 16:17:53 PDT 2020
aprantl created this revision.
aprantl added reviewers: vsk, steven_wu, friss, davide.
aprantl added a project: debug-info.
Herald added subscribers: dexonsmith, hiraditya.
This patch also strips llvm.dbg.addr intrinsics when downgrading debug info to linetables-only.
https://reviews.llvm.org/D77343
Files:
llvm/lib/IR/DebugInfo.cpp
llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-localvars.ll
Index: llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-localvars.ll
===================================================================
--- llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-localvars.ll
+++ llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-localvars.ll
@@ -3,14 +3,18 @@
define void @f() !dbg !4 {
entry:
%i = alloca i32, align 4
- ; CHECK-NOT: llvm.dbg.declare
+ ; CHECK-NOT: llvm.dbg.{{addr|declare|value}}
call void @llvm.dbg.declare(metadata i32* %i, metadata !11, metadata !13), !dbg !14
+ call void @llvm.dbg.addr(metadata i32* %i, metadata !16, metadata !13), !dbg !14
store i32 42, i32* %i, align 4, !dbg !14
+ call void @llvm.dbg.value(metadata i32 0, metadata !16, metadata !13), !dbg !15
ret void, !dbg !15
}
; Function Attrs: nounwind readnone
+declare void @llvm.dbg.addr(metadata, metadata, metadata)
declare void @llvm.dbg.declare(metadata, metadata, metadata)
+declare void @llvm.dbg.value(metadata, metadata, metadata)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!7, !8, !9}
@@ -22,6 +26,7 @@
; CHECK: ![[F]] = distinct !DISubprogram(name: "f"
; CHECK-NOT: retainedNodes:
; CHECK-NOT: distinct !DISubprogram(name: "f"
+; CHECK-NOT: DILocalVariable
!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2)
!5 = !DISubroutineType(types: !6)
!6 = !{null}
@@ -34,3 +39,4 @@
!13 = !DIExpression()
!14 = !DILocation(line: 1, column: 16, scope: !4)
!15 = !DILocation(line: 1, column: 24, scope: !4)
+!16 = !DILocalVariable(name: "j", scope: !4, file: !1, line: 1, type: !12)
Index: llvm/lib/IR/DebugInfo.cpp
===================================================================
--- llvm/lib/IR/DebugInfo.cpp
+++ llvm/lib/IR/DebugInfo.cpp
@@ -606,6 +606,7 @@
Changed = true;
}
};
+ RemoveUses("llvm.dbg.addr");
RemoveUses("llvm.dbg.declare");
RemoveUses("llvm.dbg.value");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77343.254639.patch
Type: text/x-patch
Size: 1995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200402/5a5c59c7/attachment.bin>
More information about the llvm-commits
mailing list