[PATCH] D38184: Move the stripping of malformed debug info from the Verifier to AutoUpgrade.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 11:15:48 PDT 2017


aprantl created this revision.
Herald added subscribers: eraman, mehdi_amini.

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 backwards compatibility,
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 NFCish 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 and an Asserts build would have
asserted, after this patch the Verifier will report a fatal error.
I believe that the new behavior is actually more desirable anyway.


Repository:
  rL LLVM

https://reviews.llvm.org/D38184

Files:
  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/DebugInfo/Generic/invalid.ll
  test/DebugInfo/Generic/location-verifier.ll
  test/DebugInfo/Generic/piece-verifier.ll
  test/DebugInfo/pr34186.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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38184.116376.patch
Type: text/x-patch
Size: 38928 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170922/a516277a/attachment.bin>


More information about the llvm-commits mailing list