LLVM 22.0.0git
|
Helper class to manage the recursive combining of hash_combine arguments. More...
#include "llvm/ADT/Hashing.h"
Public Member Functions | |
hash_combine_recursive_helper () | |
Construct a recursive hash combining helper. | |
template<typename T> | |
char * | combine_data (size_t &length, char *buffer_ptr, char *buffer_end, T data) |
Combine one chunk of data into the current in-flight hash. | |
template<typename T, typename ... Ts> | |
hash_code | combine (size_t length, char *buffer_ptr, char *buffer_end, const T &arg, const Ts &...args) |
Recursive, variadic combining method. | |
hash_code | combine (size_t length, char *buffer_ptr, char *buffer_end) |
Base case for recursive, variadic combining. |
Public Attributes | |
char | buffer [64] = {} |
hash_state | state |
const uint64_t | seed |
Helper class to manage the recursive combining of hash_combine arguments.
This class exists to manage the state and various calls involved in the recursive combining of arguments used in hash_combine. It is particularly useful at minimizing the code in the recursive calls to ease the pain caused by a lack of variadic functions.
|
inline |
Construct a recursive hash combining helper.
This sets up the state for a recursive hash combine, including getting the seed and buffer setup.
Definition at line 496 of file Hashing.h.
References llvm::hashing::detail::get_execution_seed(), and seed.
|
inline |
Base case for recursive, variadic combining.
The base case when combining arguments recursively is reached when all arguments have been handled. It flushes the remaining buffer and constructs a hash_code.
Definition at line 558 of file Hashing.h.
References buffer, llvm::hashing::detail::hash_short(), seed, and state.
|
inline |
Recursive, variadic combining method.
This function recurses through each argument, combining that argument into a single hash.
Definition at line 545 of file Hashing.h.
References args, combine(), combine_data(), llvm::hashing::detail::get_hashable_data(), and T.
Referenced by combine(), and llvm::hash_combine().
|
inline |
Combine one chunk of data into the current in-flight hash.
This merges one chunk of data into the hash. First it tries to buffer the data. If the buffer is full, it hashes the buffer into its hash_state, empties it, and then merges the new chunk in. This also handles cases where the data straddles the end of the buffer.
Definition at line 506 of file Hashing.h.
References buffer, data, llvm_unreachable, seed, state, llvm::hashing::detail::store_and_advance(), and T.
Referenced by combine().
char llvm::hashing::detail::hash_combine_recursive_helper::buffer[64] = {} |
Definition at line 487 of file Hashing.h.
Referenced by combine(), combine_data(), and llvm::hash_combine().
Definition at line 489 of file Hashing.h.
Referenced by combine(), combine_data(), and hash_combine_recursive_helper().
hash_state llvm::hashing::detail::hash_combine_recursive_helper::state |
Definition at line 488 of file Hashing.h.
Referenced by combine(), and combine_data().