Tie the Verifier class to a Module; NFCI
authorSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 2 Aug 2016 01:34:50 +0000 (01:34 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 2 Aug 2016 01:34:50 +0000 (01:34 +0000)
commit4b54b7f5caee5ecdfda611dec10d956d9928edee
tree0564a29e1ee68bb9a9695d314207d2ed7e6c1dfc
parentd0e8d251eb5516ac3c27cb607295278587088e86
Tie the Verifier class to a Module; NFCI

Summary:
This commit changes the Verifier class to accept a Module via the
constructor to make it obvious that a specific instance of the class is
only intended to work with a specific module.  The `updateModule` setter
(despite being private) was making this fact less transparent.

There are fields in the `Verifier` class like `DeoptimizeDeclarations`
and `GlobalValueVisited` which are module specific, so a given
Verifier instance will not in fact work across multiple modules today.
This change just makes that more obvious.

The motivation is to make it easy to get to the datalayout of the
module unambiguously.  That is required to verify that `inttoptr` and
`ptrtoint` constant expressions are well typed in the face of
non-integral pointer types.

Reviewers: dexonsmith, bkramer, majnemer, chandlerc

Subscribers: mehdi_amini, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D23040

llvm-svn: 277409
llvm/lib/IR/Verifier.cpp