This is an archive of the discontinued LLVM Phabricator instance.

Separate the Verifier into an analysis and a transformation pass optionally stripping malformed debug info.
ClosedPublic

Authored by aprantl on May 5 2016, 11:20 AM.

Details

Reviewers
mehdi_amini
Summary

This patch separates the Verifier into an analysis and a transformation pass, with the transformation pass optionally stripping malformed debug info.

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

Diff Detail

Event Timeline

aprantl updated this revision to Diff 56319.May 5 2016, 11:20 AM
aprantl retitled this revision from to Separate the Verifier into an analysis and a transformation pass optionally stripping malformed debug info..
aprantl updated this object.
aprantl added a reviewer: mehdi_amini.
aprantl added subscribers: dexonsmith, llvm-commits.

This patch is doing the the same thing that D19987 does for LTO for the regular pipeline. Frontends like clang invoke the Verifier by adding it to the pass pipeline.

aprantl updated this revision to Diff 56505.May 7 2016, 11:15 AM

Rebase on trunk, address review feedback, and upload the patch to the correct review this time m(

mehdi_amini accepted this revision.May 7 2016, 11:31 AM
mehdi_amini edited edge metadata.
mehdi_amini added inline comments.
include/llvm/IR/Verifier.h
57

Doxygen?

lib/IR/DiagnosticInfo.cpp
127

I'm worried what this displays, should it be getModule().getModuleIdentifier() or something similar?

lib/IR/Verifier.cpp
4511

So from now on the verifier will never assert on invalid debug info but will drop them right?

This revision is now accepted and ready to land.May 7 2016, 11:31 AM
aprantl marked an inline comment as done.May 9 2016, 10:02 AM
aprantl added inline comments.
lib/IR/Verifier.cpp
4511

No, in an Asserts build, it will assert on invalid debug info, iff fatal errors are requested (which is the default and pretty much only disabled for unit tests).

aprantl closed this revision.May 9 2016, 10:44 AM

Thanks! Committed as r268937.