[PATCH] D64640: PDB HashTable: Move TraitsT from class parameter to the methods that need it

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 11:45:43 PDT 2019


rnk added a comment.

> 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 traits are needed to do any actual hashing. I think I have a bit of a preference for the code as it is before your change. Now all the hash lookup operations have to take an extra parameter, and the caller is responsible for managing the lifetime of a new object that probably should exactly match the lifetime of the hash table.

What do you think of having a traits-less HashTableView or HashTableBase and having HashTable inherit from it? Would that solve your use case?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64640/new/

https://reviews.llvm.org/D64640





More information about the llvm-commits mailing list