LLVM 23.0.0git
Hashing.h File Reference
#include "llvm/ADT/ADL.h"
#include "llvm/Config/abi-breaking.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/SwapByteOrder.h"
#include "llvm/Support/type_traits.h"
#include "llvm/Support/xxhash.h"
#include <algorithm>
#include <array>
#include <cassert>
#include <cstring>
#include <memory>
#include <optional>
#include <string>
#include <tuple>
#include <utility>

Go to the source code of this file.

Classes

class  llvm::hash_code
 An opaque object representing a hash code. More...
struct  llvm::hashing::detail::is_hashable_data< T >
 Trait to indicate whether a type's bits can be hashed directly. More...
struct  llvm::hashing::detail::is_hashable_data< std::pair< T, U > >
struct  llvm::DenseMapInfo< hash_code, void >
struct  std::hash< llvm::hash_code >

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::hashing
namespace  llvm::hashing::detail
namespace  std
 Implement std::hash so that hash_code can be used in STL containers.

Functions

template<typename T>
std::enable_if_t< is_integral_or_enum< T >::value, hash_codellvm::hash_value (T value)
 Compute a hash_code for any integer value.
template<typename T>
hash_code llvm::hash_value (const T *ptr)
 Compute a hash_code for a pointer's address.
template<typename T, typename U>
hash_code llvm::hash_value (const std::pair< T, U > &arg)
 Compute a hash_code for a pair of objects.
template<typename... Ts>
hash_code llvm::hash_value (const std::tuple< Ts... > &arg)
 Compute a hash_code for a tuple.
template<typename T>
hash_code llvm::hash_value (const std::basic_string< T > &arg)
 Compute a hash_code for a standard string.
template<typename T>
hash_code llvm::hash_value (const std::optional< T > &arg)
 Compute a hash_code for a standard string.
uint32_t llvm::hashing::detail::fetch32 (const char *p)
constexpr uint64_t llvm::hashing::detail::hash_16_bytes (uint64_t low, uint64_t high)
uint64_t llvm::hashing::detail::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.
hash_code llvm::hashing::detail::combine_bytes (const char *data, size_t len)
 Hash a contiguous byte buffer to a hash_code.
template<typename T>
auto llvm::hashing::detail::get_hashable_data (const T &value)
 Helper to get the hashable data representation for a type.
template<typename InputIteratorT>
hash_code llvm::hashing::detail::hash_combine_range_impl (InputIteratorT first, InputIteratorT last)
 Implement the combining of integral values into a hash_code.
template<typename ValueT>
std::enable_if_t< is_hashable_data< ValueT >::value, hash_codellvm::hashing::detail::hash_combine_range_impl (ValueT *first, ValueT *last)
 Implement the combining of integral values into a hash_code.
template<typename... Ts>
constexpr size_t llvm::hashing::detail::total_hashable_size ()
 Sum of sizeof(get_hashable_data(arg)) across a parameter pack.
template<typename T>
void llvm::hashing::detail::store_hashable_data (char *buf, size_t &off, const T &arg)
 Copy get_hashable_data(arg) into buf at offset off, advancing off.
template<typename InputIteratorT>
hash_code llvm::hash_combine_range (InputIteratorT first, InputIteratorT last)
 Compute a hash_code for a sequence of values.
template<typename RangeT>
hash_code llvm::hash_combine_range (RangeT &&R)
template<typename... Ts>
hash_code llvm::hash_combine (const Ts &...args)
 Combine values into a single hash_code.
hash_code llvm::hashing::detail::hash_integer_value (uint64_t value)
 Helper to hash the value of a single integer.