forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow the LTO code generator to strip invalid debug info from the input.
This patch introduces a new option -lto-strip-invalid-debug-info, which drops malformed debug info from the input. The problem I'm trying to solve with this sequence of patches is that historically we've done a really bad job at verifying debug info. We want to be able to make the verifier stricter without having to worry about breaking bitcode compatibility with existing producers. For example, we don't necessarily want IR produced by an older version of clang to be rejected by an LTO link just because of malformed debug info, and rather provide an option to strip it. Note that merely outdated (but well-formed) debug info would continue to be auto-upgraded in this scenario. rdar://problem/25818489 http://reviews.llvm.org/D19987 This reapplies 268936 with a test case fix for Linux (-exported-symbol foo) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268965 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
b8b6ac5
commit b6708cf
Showing
5 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; RUN: not llvm-lto -lto-strip-invalid-debug-info=false \ | ||
; RUN: -o %t.o %S/Inputs/strip-debug-info.bc 2>&1 | \ | ||
; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-ERR | ||
; RUN: llvm-lto -lto-strip-invalid-debug-info=true \ | ||
; RUN: -exported-symbol foo -exported-symbol _foo \ | ||
; RUN: -o %t.o %S/Inputs/strip-debug-info.bc 2>&1 | \ | ||
; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-WARN | ||
; RUN: llvm-nm %t.o | FileCheck %s | ||
|
||
; CHECK-ERR: Broken module found, compilation aborted | ||
; CHECK-WARN: Invalid debug info found, debug info will be stripped | ||
; CHECK: foo | ||
define void @foo() { | ||
ret void | ||
} | ||
|
||
!llvm.module.flags = !{!0} | ||
!llvm.dbg.cu = !{!1} | ||
|
||
!0 = !{i32 2, !"Debug Info Version", i32 3} | ||
!1 = !DIFile(filename: "broken", directory: "") |