LLVM  8.0.1
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
llvm::hashing::detail::hash_state Struct Reference

The intermediate state used during hashing. More...

#include "llvm/ADT/Hashing.h"

Collaboration diagram for llvm::hashing::detail::hash_state:
Collaboration graph
[legend]

Public Member Functions

void mix (const char *s)
 Mix in a 64-byte buffer of data. More...
 
uint64_t finalize (size_t length)
 Compute the final 64-bit hash code value based on the current state and the length of bytes hashed. More...
 

Static Public Member Functions

static hash_state create (const char *s, uint64_t seed)
 Create a new hash_state structure and initialize it based on the seed and the first 64-byte chunk. More...
 
static void mix_32_bytes (const char *s, uint64_t &a, uint64_t &b)
 Mix 32-bytes from the input sequence into the 16-bytes of 'a' and 'b', including whatever is already in 'a' and 'b'. More...
 

Public Attributes

uint64_t h0
 
uint64_t h1
 
uint64_t h2
 
uint64_t h3
 
uint64_t h4
 
uint64_t h5
 
uint64_t h6
 

Detailed Description

The intermediate state used during hashing.

Currently, the algorithm for computing hash codes is based on CityHash and keeps 56 bytes of arbitrary state.

Definition at line 260 of file Hashing.h.

Member Function Documentation

◆ create()

static hash_state llvm::hashing::detail::hash_state::create ( const char s,
uint64_t  seed 
)
inlinestatic

Create a new hash_state structure and initialize it based on the seed and the first 64-byte chunk.

This effectively performs the initial mix.

Definition at line 266 of file Hashing.h.

References h4, h5, h6, llvm::hashing::detail::hash_16_bytes(), llvm::hashing::detail::k1, mix(), rotate, and llvm::hashing::detail::shift_mix().

Referenced by llvm::hashing::detail::hash_combine_recursive_helper::combine_data(), and llvm::hashing::detail::hash_combine_range_impl().

◆ finalize()

uint64_t llvm::hashing::detail::hash_state::finalize ( size_t  length)
inline

Compute the final 64-bit hash code value based on the current state and the length of bytes hashed.

Definition at line 307 of file Hashing.h.

References llvm::hashing::detail::fixed_seed_override, llvm::hashing::detail::hash_16_bytes(), and llvm::hashing::detail::shift_mix().

Referenced by llvm::hashing::detail::hash_combine_recursive_helper::combine(), and llvm::hashing::detail::hash_combine_range_impl().

◆ mix()

void llvm::hashing::detail::hash_state::mix ( const char s)
inline

Mix in a 64-byte buffer of data.

We mix all 64 bytes even when the chunk length is smaller, but we record the actual length.

Definition at line 290 of file Hashing.h.

References llvm::hashing::detail::fetch64(), llvm::hashing::detail::k1, rotate, and std::swap().

Referenced by llvm::hashing::detail::hash_combine_recursive_helper::combine(), llvm::hashing::detail::hash_combine_recursive_helper::combine_data(), create(), and llvm::hashing::detail::hash_combine_range_impl().

◆ mix_32_bytes()

static void llvm::hashing::detail::hash_state::mix_32_bytes ( const char s,
uint64_t &  a,
uint64_t &  b 
)
inlinestatic

Mix 32-bytes from the input sequence into the 16-bytes of 'a' and 'b', including whatever is already in 'a' and 'b'.

Definition at line 277 of file Hashing.h.

References llvm::hashing::detail::fetch64(), and rotate.

Member Data Documentation

◆ h0

uint64_t llvm::hashing::detail::hash_state::h0

Definition at line 261 of file Hashing.h.

◆ h1

uint64_t llvm::hashing::detail::hash_state::h1

Definition at line 261 of file Hashing.h.

◆ h2

uint64_t llvm::hashing::detail::hash_state::h2

Definition at line 261 of file Hashing.h.

◆ h3

uint64_t llvm::hashing::detail::hash_state::h3

Definition at line 261 of file Hashing.h.

◆ h4

uint64_t llvm::hashing::detail::hash_state::h4

Definition at line 261 of file Hashing.h.

Referenced by create().

◆ h5

uint64_t llvm::hashing::detail::hash_state::h5

Definition at line 261 of file Hashing.h.

Referenced by create().

◆ h6

uint64_t llvm::hashing::detail::hash_state::h6

Definition at line 261 of file Hashing.h.

Referenced by create().


The documentation for this struct was generated from the following file: