Verifier: Remove the separate DebugInfoVerifier class
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 20 Mar 2015 00:48:23 +0000 (00:48 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 20 Mar 2015 00:48:23 +0000 (00:48 +0000)
commite48bd555a001410e7a7979681bf18d82bccb66b1
tree79063bcb7f4a339f0a69771cd77e901e61589b7c
parentffe6f0ffdda4d390101473c46129fafd7774eb2b
Verifier: Remove the separate DebugInfoVerifier class

Remove the separate `DebugInfoVerifier` class, as a partial step toward
better integrating debug info verification with the `Verifier`.

Right now, verification of debug info is kind of a mess.

  - There are `DIDescriptor::Verify()` checks live in `DebugInfo.cpp`.
    These return `bool`, and there's no way to see (except by opening a
    debugger) why they fail.
  - We rely on `DebugInfoFinder` to traverse the debug info graph and
    dig up nodes.  However, the regular `Verifier` visits many of these
    nodes when it calls into debug info intrinsic operands.  Visiting
    twice and running different checks is kind of absurd.
  - Moreover, `DebugInfoFinder` asserts on failed type resolution -- the
    verifier should never assert!

By integrating the two verifiers, I'm aiming at solving these problems
(work to be done, obviously).  Verification can be localized to the
`Verifier`; we can use a naive `MDNode` operand traversal to find all
the nodes; we can verify type references instead of asserting on
failure.

There are `assert()`s sprinkled throughout the optimizer and dwarf
backend on `DIDescriptor::Verify()` checks.  This is a hangover from
when the debug info verifier was off, so I plan to remove them as I go
(once I confirm that the checks are done at verification time).

Note: to keep the behaviour of only running the debug info verifier when
-verify succeeds, I've added an `EverBroken` flag.  Once the
`DebugInfoFinder` assertions are gone and the two traversals have been
merged, I expect to be able to remove this.

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