diff --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h --- a/llvm/include/llvm/ADT/Hashing.h +++ b/llvm/include/llvm/ADT/Hashing.h @@ -651,24 +651,8 @@ return hash_combine(arg.first, arg.second); } -// Implementation details for the hash_value overload for std::tuple<...>(...). -namespace hashing { -namespace detail { - -template -hash_code hash_value_tuple_helper(const std::tuple &arg, - std::index_sequence) { - return hash_combine(std::get(arg)...); -} - -} // namespace detail -} // namespace hashing - -template -hash_code hash_value(const std::tuple &arg) { - // TODO: Use std::apply when LLVM starts using C++17. - return ::llvm::hashing::detail::hash_value_tuple_helper( - arg, typename std::index_sequence_for()); +template hash_code hash_value(const std::tuple &arg) { + return std::apply([](const auto &...xs) { return hash_combine(xs...); }, arg); } // Declared and documented above, but defined here so that any of the hashing