diff --git a/llvm/include/llvm/Support/HashBuilder.h b/llvm/include/llvm/Support/HashBuilder.h --- a/llvm/include/llvm/Support/HashBuilder.h +++ b/llvm/include/llvm/Support/HashBuilder.h @@ -26,6 +26,15 @@ namespace llvm { +namespace hashbuilder_detail { +/// Trait to indicate whether a type's bits can be hashed directly (after +/// endianness correction). +template +struct IsHashableData + : std::integral_constant::value> {}; + +} // namespace hashbuilder_detail + /// Declares the hasher member, and functions forwarding directly to the hasher. template class HashBuilderBase { public: @@ -80,11 +89,6 @@ class HashBuilderImpl : public HashBuilderBase { static_assert(Endianness != support::endianness::native, "HashBuilder should canonicalize endianness"); - /// Trait to indicate whether a type's bits can be hashed directly (after - /// endianness correction). - template - struct IsHashableData - : std::integral_constant::value> {}; public: explicit HashBuilderImpl(HasherT &Hasher) @@ -95,7 +99,7 @@ /// Implement hashing for hashable data types, e.g. integral or enum values. template - std::enable_if_t::value, HashBuilderImpl &> add(T Value) { + std::enable_if_t::value, HashBuilderImpl &> add(T Value) { return adjustForEndiannessAndAdd(Value); } @@ -118,7 +122,7 @@ // details of `ArrayRef::begin()` and `ArrayRef::end()`. Explicitly call // `update` to guarantee the fast path. add(Value.size()); - if (IsHashableData::value && + if (hashbuilder_detail::IsHashableData::value && Endianness == support::endian::system_endianness()) { this->update( makeArrayRef(reinterpret_cast(Value.begin()), @@ -242,7 +246,7 @@ /// ``` template std::enable_if_t::value && - !IsHashableData::value, + !hashbuilder_detail::IsHashableData::value, HashBuilderImpl &> add(const T &Value) { addHash(*this, Value); @@ -334,7 +338,7 @@ } template - std::enable_if_t::value && + std::enable_if_t::value && Endianness == support::endian::system_endianness(), HashBuilderImpl &> addRangeElementsImpl(T *First, T *Last, std::forward_iterator_tag) {