mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-14 23:48:49 +00:00
5bd98bf7d6
This adds a new function to DebugInfo.cpp that takes an llvm::Module as input and removes all debug info metadata that is not directly needed for line tables, thus effectively stripping all type and variable information from the module. The primary motivation for this feature was the bitcode work flow (cf. http://lists.llvm.org/pipermail/llvm-dev/2016-June/100643.html for more background). This is not wired up yet, but will be in subsequent patches. For testing, the new functionality is exposed to opt with a -strip-nonlinetable-debuginfo option. The secondary use-case (and one that works right now!) is as a reduction pass in bugpoint. I added two new bugpoint options (-disable-strip-debuginfo and -disable-strip-debug-types) to control the new features. By default it will first attempt to remove all debug information, then only the type info, and then proceed to hack at any remaining MDNodes. Thanks to Adrian Prantl for stewarding this patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285094 91177308-0d34-0410-b5e6-96231b3b80d8
40 lines
1.9 KiB
LLVM
40 lines
1.9 KiB
LLVM
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes -disable-strip-debuginfo > /dev/null
|
|
; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
|
|
; RUN-DISABLE: bugpoint -disable-namedmd-remove -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes > /dev/null
|
|
; RUN-DISABLE: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
|
|
; REQUIRES: loadable_module
|
|
|
|
; CHECK: !llvm.dbg.cu = !{![[FIRST:[0-9]+]], ![[SECOND:[0-9]+]]}
|
|
; CHECK-DISABLE: !llvm.dbg.cu = !{![[FIRST:[0-9]+]], ![[SECOND:[0-9]+]],
|
|
; CHECK-DISABLE-SAME: ![[THIRD:[0-9]+]], ![[FOURTH:[0-9]+]], ![[FIFTH:[0-9]+]]}
|
|
!llvm.dbg.cu = !{!0, !1, !2, !3, !4, !5}
|
|
; CHECK-NOT: !named
|
|
; CHECK-DISABLE: !named
|
|
!named = !{!0, !1, !2, !3, !4, !5}
|
|
; CHECK: !llvm.module.flags = !{![[DIVERSION:[0-9]+]]}
|
|
!llvm.module.flags = !{!6, !7}
|
|
|
|
; CHECK-DAG: ![[FIRST]] = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
; CHECK-DAG: ![[SECOND]] = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
; CHECK-DAG: ![[DIVERSION]] = !{i32 2, !"Debug Info Version", i32 3}
|
|
; CHECK-DAG: !DIFile(filename: "a", directory: "b")
|
|
|
|
; 4 nodes survive. Due to renumbering !4 should not exist
|
|
; CHECK-NOT: !4
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
file: !8)
|
|
!1 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
file: !8)
|
|
!2 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
file: !8)
|
|
!3 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
file: !8)
|
|
!4 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
file: !8)
|
|
!5 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
file: !8)
|
|
!6 = !{i32 2, !"Dwarf Version", i32 2}
|
|
!7 = !{i32 2, !"Debug Info Version", i32 3}
|
|
!8 = !DIFile(filename: "a", directory: "b")
|