Verifier: Don't call debug info verifier if the module is broken
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 16 Mar 2015 21:23:56 +0000 (21:23 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 16 Mar 2015 21:23:56 +0000 (21:23 +0000)
commit9b4250d309ee785e1e33f3573bd4560c2d92003f
tree5c74bb4c32f4f4cde3a675f1923239f3f56d88dc
parentbee74a3ad49392686025eb267e19d30ca78aec30
Verifier: Don't call debug info verifier if the module is broken

If `Verifier` has already found a failure, don't call
`DebugInfoVerifier`.  The latter sometimes crashes in `DebugInfoFinder`
when the former would give a nice message.  The only two cases I found
it crashing are explicit verifier tests I've added:

  - test/Verifier/llvm.dbg.declare-expression.ll
  - test/Verifier/llvm.dbg.value-expression.ll

However, I assume frontends with bugs will create invalid IR as well.

IMO, the `DebugInfoVerifier` should never crash (instead, it should fail
to verify), but subtleties like that will be easier to work out once
it's enabled again.

This is part of PR22777.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232418 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Verifier.cpp