diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-10-02 18:31:29 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-10-02 18:31:29 +0000 |
commit | 733fe2f23133cccdd7bac660abd76577b0589081 (patch) | |
tree | 001487e93e5b65a1aa873a535b50696fed02eea9 /test/LTO | |
parent | fc20547ae6d3528a850caf7438d4c276ab47b3be (diff) |
Move the stripping of invalid debug info from the Verifier to AutoUpgrade.
This came out of a recent discussion on llvm-dev
(https://reviews.llvm.org/D38042). Currently the Verifier will strip
the debug info metadata from a module if it finds the dbeug info to be
malformed. This feature is very valuable since it allows us to improve
the Verifier by making it stricter without breaking bcompatibility,
but arguable the Verifier pass should not be modifying the IR. This
patch moves the stripping of broken debug info into AutoUpgrade
(UpgradeDebugInfo to be precise), which is a much better location for
this since the stripping of malformed (i.e., produced by older, buggy
versions of Clang) is a (harsh) form of AutoUpgrade.
This change is mostly NFC in nature, the one big difference is the
behavior when LLVM module passes are introducing malformed debug
info. Prior to this patch, a NoAsserts build would have printed a
warning and stripped the debug info, after this patch the Verifier
will report a fatal error. I believe this behavior is actually more
desirable anyway.
Differential Revision: https://reviews.llvm.org/D38184
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314699 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/LTO')
-rw-r--r-- | test/LTO/X86/strip-debug-info-no-call-loc.ll | 5 | ||||
-rw-r--r-- | test/LTO/X86/strip-debug-info.ll | 24 |
2 files changed, 4 insertions, 25 deletions
diff --git a/test/LTO/X86/strip-debug-info-no-call-loc.ll b/test/LTO/X86/strip-debug-info-no-call-loc.ll index 39b8c40c3a4..4a684b276b7 100644 --- a/test/LTO/X86/strip-debug-info-no-call-loc.ll +++ b/test/LTO/X86/strip-debug-info-no-call-loc.ll @@ -1,6 +1,5 @@ ; RUN: llvm-as %s -disable-verify -o %t.bc -; RUN: llvm-lto -lto-strip-invalid-debug-info=true \ -; RUN: -exported-symbol f -exported-symbol _f \ +; RUN: llvm-lto -exported-symbol f -exported-symbol _f \ ; RUN: -o %t.o %t.bc 2>&1 | \ ; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-WARN ; RUN: llvm-nm %t.o | FileCheck %s @@ -8,7 +7,7 @@ ; Check that missing debug locations on inlinable calls are a ; recoverable error. -; CHECK-WARN: Invalid debug info found, debug info will be stripped +; CHECK-WARN: warning{{.*}} ignoring invalid debug info ; CHECK: {{f$}} target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx" diff --git a/test/LTO/X86/strip-debug-info.ll b/test/LTO/X86/strip-debug-info.ll index 6b774516444..f8db5a15fe9 100644 --- a/test/LTO/X86/strip-debug-info.ll +++ b/test/LTO/X86/strip-debug-info.ll @@ -1,52 +1,32 @@ ; RUN: llvm-as -disable-verify %s -o %t.bc ; ---- Full LTO --------------------------------------------- -; RUN: not llvm-lto -lto-strip-invalid-debug-info=false \ -; RUN: -o %t.o %t.bc 2>&1 | \ -; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-ERR -; RUN: llvm-lto -lto-strip-invalid-debug-info=true \ +; RUN: llvm-lto \ ; RUN: -exported-symbol foo -exported-symbol _foo \ ; RUN: -o %t.o %t.bc 2>&1 | \ ; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-WARN ; RUN: llvm-nm %t.o | FileCheck %s ; ---- Thin LTO (codegen only) ------------------------------ -; RUN: not llvm-lto -thinlto -thinlto-action=codegen \ -; RUN: -lto-strip-invalid-debug-info=false \ -; RUN: %t.bc -disable-verify 2>&1 | \ -; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-ERR ; RUN: llvm-lto -thinlto -thinlto-action=codegen \ -; RUN: -lto-strip-invalid-debug-info=true \ ; RUN: %t.bc -disable-verify 2>&1 | \ ; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-WARN ; ---- Thin LTO (optimize, strip main file) ----------------- ; RUN: opt -disable-verify -module-summary %s -o %t.bc ; RUN: opt -disable-verify -module-summary %S/Inputs/strip-debug-info-bar.ll \ ; RUN: -o %t2.bc -; RUN: not llvm-lto -thinlto -thinlto-action=run \ -; RUN: -lto-strip-invalid-debug-info=false \ -; RUN: %t.bc -disable-verify 2>&1 | \ -; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-ERR ; RUN: llvm-lto -thinlto -thinlto-action=run \ -; RUN: -lto-strip-invalid-debug-info=true \ ; RUN: %t.bc -disable-verify 2>&1 | \ ; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-WARN ; ---- Thin LTO (optimize, strip imported file) ------------- ; RUN: opt -disable-verify -strip-debug -module-summary %t.bc -o %t-stripped.bc ; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t-stripped.bc %t2.bc -; RUN: not llvm-lto -thinlto -thinlto-action=import \ -; RUN: -thinlto-index=%t.index.bc \ -; RUN: -lto-strip-invalid-debug-info=false \ -; RUN: -exported-symbol foo -exported-symbol _foo \ -; RUN: %t-stripped.bc -disable-verify 2>&1 | \ -; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-ERR ; RUN: llvm-lto -thinlto -thinlto-action=import \ -; RUN: -lto-strip-invalid-debug-info=true \ ; RUN: -thinlto-index=%t.index.bc \ ; RUN: -exported-symbol foo -exported-symbol _foo \ ; RUN: %t-stripped.bc -disable-verify 2>&1 | \ ; RUN: FileCheck %s -allow-empty -check-prefix=CHECK-WARN ; CHECK-ERR: Broken module found, compilation aborted -; CHECK-WARN: Invalid debug info found, debug info will be stripped +; CHECK-WARN: warning{{.*}} ignoring invalid debug info ; CHECK-WARN-NOT: Broken module found ; CHECK: foo target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |