Skip to content

Commit 7a78347

Browse files
[ADT] Update comments in Hashing.h
Now that we have removed recursion in llvm#159901 and llvm#159938, this patch updates those comments that still mention recursion.
1 parent e8e0108 commit 7a78347

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

llvm/include/llvm/ADT/Hashing.h

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,10 @@ template <typename RangeT> hash_code hash_combine_range(RangeT &&R) {
476476
namespace hashing {
477477
namespace detail {
478478

479-
/// Helper class to manage the recursive combining of hash_combine
480-
/// arguments.
479+
/// Helper class to manage the combining of `hash_combine` arguments.
481480
///
482-
/// This class exists to manage the state and various calls involved in the
483-
/// recursive combining of arguments used in hash_combine. It is particularly
484-
/// useful at minimizing the code in the recursive calls to ease the pain
485-
/// caused by a lack of variadic functions.
481+
/// This class manages the state and various calls involved in combining a
482+
/// variadic argument list into a single hash.
486483
struct hash_combine_helper {
487484
char buffer[64] = {};
488485
char *buffer_ptr;
@@ -492,10 +489,10 @@ struct hash_combine_helper {
492489
const uint64_t seed;
493490

494491
public:
495-
/// Construct a recursive hash combining helper.
492+
/// Construct a hash combining helper.
496493
///
497-
/// This sets up the state for a recursive hash combine, including getting
498-
/// the seed and buffer setup.
494+
/// This sets up the state for a hash combine, including getting the seed and
495+
/// buffer setup.
499496
hash_combine_helper()
500497
: buffer_ptr(buffer), buffer_end(buffer + 64),
501498
seed(get_execution_seed()) {}
@@ -539,10 +536,9 @@ struct hash_combine_helper {
539536
}
540537
}
541538

542-
/// Recursive, variadic combining method.
539+
/// Variadic combining method.
543540
///
544-
/// This function recurses through each argument, combining that argument
545-
/// into a single hash.
541+
/// This function combines each argument into a single hash.
546542
template <typename... Ts> hash_code combine(const Ts &...args) {
547543
(combine_data(get_hashable_data(args)), ...);
548544

@@ -582,7 +578,7 @@ struct hash_combine_helper {
582578
/// *implementation* for their user-defined type. Consumers of a type should
583579
/// *not* call this routine, they should instead call 'hash_value'.
584580
template <typename... Ts> hash_code hash_combine(const Ts &...args) {
585-
// Recursively hash each argument using a helper class.
581+
// Hash each argument using a helper class.
586582
::llvm::hashing::detail::hash_combine_helper helper;
587583
return helper.combine(args...);
588584
}

0 commit comments

Comments
 (0)