[pdb] Don't verify TPI hash values up front.
authorZachary Turner <zturner@google.com>
Thu, 4 May 2017 23:53:54 +0000 (23:53 +0000)
committerZachary Turner <zturner@google.com>
Thu, 4 May 2017 23:53:54 +0000 (23:53 +0000)
commitbedc85fb4b9dbea4f2a8e5ca5ec374e9c233fe33
treee76416bbb24d106b270df57ee34409eb8d1d199c
parent1eb9a0297cb639323e97ca7f02123b035bf0b24b
[pdb] Don't verify TPI hash values up front.

Verifying the hash values as we are currently doing
results in iterating every type record before the user
even tries to access the first one, and the API user
has no control over, or ability to hook into this
process.

As a result, when the user wants to iterate over types
to print them or index them, this results in a second
iteration over the same list of types.  When there's
upwards of 1,000,000 type records, this is obviously
quite undesirable.

This patch raises the verification outside of TpiStream
, and llvm-pdbdump hooks a hash verification visitor
into the normal dumping process.  So we still verify
the hash records, but we can do it while not requiring
a second iteration over the type stream.

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

llvm-svn: 302206
llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp
llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp