LLVM: llvm::hashing::detail Namespace Reference (original) (raw)
| Classes | |
|---|---|
| struct | hash_combine_recursive_helper |
| Helper class to manage the recursive combining of hash_combine arguments. More... | |
| struct | hash_state |
| The intermediate state used during hashing. More... | |
| struct | is_hashable_data |
| Trait to indicate whether a type's bits can be hashed directly. More... | |
| struct | is_hashable_data< std::pair< T, U > > |
| Functions | |
|---|---|
| uint64_t | fetch64 (const char *p) |
| uint32_t | fetch32 (const char *p) |
| uint64_t | rotate (uint64_t val, size_t shift) |
| Bitwise right rotate. | |
| uint64_t | shift_mix (uint64_t val) |
| uint64_t | hash_16_bytes (uint64_t low, uint64_t high) |
| uint64_t | hash_1to3_bytes (const char *s, size_t len, uint64_t seed) |
| uint64_t | hash_4to8_bytes (const char *s, size_t len, uint64_t seed) |
| uint64_t | hash_9to16_bytes (const char *s, size_t len, uint64_t seed) |
| uint64_t | hash_17to32_bytes (const char *s, size_t len, uint64_t seed) |
| uint64_t | hash_33to64_bytes (const char *s, size_t len, uint64_t seed) |
| uint64_t | hash_short (const char *s, size_t length, uint64_t seed) |
| uint64_t | get_execution_seed () |
| In LLVM_ENABLE_ABI_BREAKING_CHECKS builds, the seed is non-deterministic per process (address of a function in LLVMSupport) to prevent having users depend on the particular hash values. | |
| template<typename T> | |
| auto | get_hashable_data (const T &value) |
| Helper to get the hashable data representation for a type. | |
| template<typename T> | |
| bool | store_and_advance (char *&buffer_ptr, char *buffer_end, const T &value, size_t offset=0) |
| Helper to store data from a value into a buffer and advance the pointer into that buffer. | |
| template | |
| hash_code | hash_combine_range_impl (InputIteratorT first, InputIteratorT last) |
| Implement the combining of integral values into a hash_code. | |
| template | |
| std::enable_if_t< is_hashable_data< ValueT >::value, hash_code > | hash_combine_range_impl (ValueT *first, ValueT *last) |
| Implement the combining of integral values into a hash_code. | |
| hash_code | hash_integer_value (uint64_t value) |
| Helper to hash the value of a single integer. |
| Variables | |
|---|---|
| static constexpr uint64_t | k0 = 0xc3a5c85c97cb3127ULL |
| Some primes between 2^63 and 2^64 for various uses. | |
| static constexpr uint64_t | k1 = 0xb492b66fbe98f273ULL |
| static constexpr uint64_t | k2 = 0x9ae16a3b2f90404fULL |
| static constexpr uint64_t | k3 = 0xc949d7c7509e6557ULL |
◆ fetch32()
◆ fetch64()
◆ get_execution_seed()
| uint64_t llvm::hashing::detail::get_execution_seed ( ) | inline |
|---|
◆ get_hashable_data()
template<typename T>
| auto llvm::hashing::detail::get_hashable_data | ( | const T & | value | ) |
|---|
◆ hash_16_bytes()
◆ hash_17to32_bytes()
◆ hash_1to3_bytes()
◆ hash_33to64_bytes()
◆ hash_4to8_bytes()
◆ hash_9to16_bytes()
◆ hash_combine_range_impl() [1/2]
template
| hash_code llvm::hashing::detail::hash_combine_range_impl | ( | InputIteratorT | first, |
|---|---|---|---|
| InputIteratorT | last ) |
◆ hash_combine_range_impl() [2/2]
template
| std::enable_if_t< is_hashable_data< ValueT >::value, hash_code > llvm::hashing::detail::hash_combine_range_impl | ( | ValueT * | first, |
|---|---|---|---|
| ValueT * | last ) |
Implement the combining of integral values into a hash_code.
This overload is selected when the value type of the iterator is integral and when the input iterator is actually a pointer. Rather than computing a hash_code for each object and then combining them, this (as an optimization) directly combines the integers. Also, because the integers are stored in contiguous memory, this routine avoids copying each value and directly reads from the underlying memory.
Definition at line 434 of file Hashing.h.
References llvm::hashing::detail::hash_state::create(), get_execution_seed(), and hash_short().
◆ hash_integer_value()
Helper to hash the value of a single integer.
Overloads for smaller integer types are not provided to ensure consistent behavior in the presence of integral promotions. Essentially, "hash_value('4')" and "hash_value('0' + 4)" should be the same.
Definition at line 608 of file Hashing.h.
References fetch32(), get_execution_seed(), and hash_16_bytes().
◆ hash_short()
◆ rotate()
Bitwise right rotate.
Normally this will compile to a single instruction, especially if the shift is a manifest constant.
Definition at line 162 of file Hashing.h.
Referenced by hash_9to16_bytes().
◆ shift_mix()
◆ store_and_advance()
template<typename T>
| bool llvm::hashing::detail::store_and_advance | ( | char *& | buffer_ptr, |
|---|---|---|---|
| char * | buffer_end, | ||
| const T & | value, | ||
| size_t | offset = 0 ) |
◆ k0
| uint64_t llvm::hashing::detail::k0 = 0xc3a5c85c97cb3127ULL | staticconstexpr |
|---|
◆ k1
| uint64_t llvm::hashing::detail::k1 = 0xb492b66fbe98f273ULL | staticconstexpr |
|---|
◆ k2
| uint64_t llvm::hashing::detail::k2 = 0x9ae16a3b2f90404fULL | staticconstexpr |
|---|
◆ k3
| uint64_t llvm::hashing::detail::k3 = 0xc949d7c7509e6557ULL | staticconstexpr |
|---|