PDB HashTable: Move TraitsT from class parameter to the methods that need it
authorNico Weber <nicolasweber@gmx.de>
Fri, 12 Jul 2019 23:30:55 +0000 (23:30 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 12 Jul 2019 23:30:55 +0000 (23:30 +0000)
commit51a52b58930cd1bb2351bf7017adfd55073f6553
tree1c6c3d96b7ff686e481139be9882018495d143ba
parent882fdf68b74d3199cb84b062709b702ed610f547
PDB HashTable: Move TraitsT from class parameter to the methods that need it

The traits object is only used by a few methods. Deserializing a hash
table and walking it is possible without the traits object, so it
shouldn't be required to build a dummy object for that use case.

The TraitsT object used to be a function template parameter before
r327647, this restores it to that state.

This makes it clear that the traits object isn't needed at all in 1 of
the current 3 uses of HashTable (and I am going to add another use that
doesn't need it), and that the default PdbHashTraits isn't used outside
of tests.

While here, also re-enable 3 checks in the test that were commented out
(which requires making HashTableInternals templated and giving FooBar
an operator==).

No intended behavior change.

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

llvm-svn: 365974
llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h
llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp
llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
llvm/unittests/DebugInfo/PDB/HashTableTest.cpp