]> granicus.if.org Git - llvm/commit
Move the stripping of invalid debug info from the Verifier to AutoUpgrade.
authorAdrian Prantl <aprantl@apple.com>
Mon, 2 Oct 2017 18:31:29 +0000 (18:31 +0000)
committerAdrian Prantl <aprantl@apple.com>
Mon, 2 Oct 2017 18:31:29 +0000 (18:31 +0000)
commit733fe2f23133cccdd7bac660abd76577b0589081
tree001487e93e5b65a1aa873a535b50696fed02eea9
parentfc20547ae6d3528a850caf7438d4c276ab47b3be
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
46 files changed:
include/llvm/AsmParser/Parser.h
include/llvm/IRReader/IRReader.h
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLParser.h
lib/AsmParser/Parser.cpp
lib/IR/AutoUpgrade.cpp
lib/IR/DebugInfo.cpp
lib/IR/Metadata.cpp
lib/IR/Verifier.cpp
lib/IRReader/IRReader.cpp
lib/LTO/LTOCodeGenerator.cpp
lib/LTO/ThinLTOCodeGenerator.cpp
test/Analysis/GlobalsModRef/pr12351.ll
test/DebugInfo/Generic/invalid.ll
test/DebugInfo/Generic/location-verifier.ll
test/DebugInfo/Generic/piece-verifier.ll
test/DebugInfo/pr34186.ll
test/DebugInfo/pr34672.ll
test/LTO/X86/strip-debug-info-no-call-loc.ll
test/LTO/X86/strip-debug-info.ll
test/Verifier/DILocation-parents.ll
test/Verifier/DISubprogram.ll
test/Verifier/callsite-dbgloc.ll
test/Verifier/dbg-difile-crash.ll
test/Verifier/dbg-invalid-compileunit.ll
test/Verifier/dbg-invalid-named-metadata.ll
test/Verifier/dbg-invalid-retaintypes.ll
test/Verifier/dbg-line-without-file.ll
test/Verifier/dbg-null-retained-type.ll
test/Verifier/dbg.ll
test/Verifier/diglobalvariable.ll
test/Verifier/fnarg-debuginfo.ll
test/Verifier/fragment.ll
test/Verifier/func-dbg.ll
test/Verifier/llvm.dbg.declare-address.ll
test/Verifier/llvm.dbg.declare-expression.ll
test/Verifier/llvm.dbg.declare-variable.ll
test/Verifier/llvm.dbg.value-expression.ll
test/Verifier/llvm.dbg.value-value.ll
test/Verifier/llvm.dbg.value-variable.ll
test/Verifier/metadata-function-dbg.ll
test/Verifier/pr34325.ll
test/Verifier/tbaa.ll
tools/llvm-as/llvm-as.cpp
tools/opt/opt.cpp
unittests/IR/VerifierTest.cpp