[PATCH] D109024: [Support] Automatically support `hash_value` when `HashBuilder` support is available.

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 15:48:32 PDT 2021


dexonsmith added inline comments.


================
Comment at: llvm/include/llvm/Support/HashBuilder.h:30-37
+namespace hashbuilder_detail {
+/// Trait to indicate whether a type's bits can be hashed directly (after
+/// endianness correction).
+template <typename U>
+struct IsHashableData
+    : std::integral_constant<bool, is_integral_or_enum<U>::value> {};
+
----------------
This change should be a separate NFC commit, since it touches a lot of lines (and isn't directly related)


================
Comment at: llvm/include/llvm/Support/HashBuilder.h:91
 class HashBuilderImpl : public HashBuilderBase<HasherT> {
+public:
   static_assert(Endianness != support::endianness::native,
----------------
Diff would be reduced if teh `public:` didn't move before teh `static_assert`


================
Comment at: llvm/include/llvm/Support/HashBuilder.h:410
+
+namespace detail {
+class HashCodeHasher {
----------------
Probably cleaner to use the same name for the detail namespace as above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109024



More information about the llvm-commits mailing list