struct hash_combine_recursive_helper

Declaration

struct hash_combine_recursive_helper { /* full declaration omitted */ };

Description

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.

Declared at: llvm/include/llvm/ADT/Hashing.h:494

Member Variables

public char[64] buffer = {}
public llvm::hashing::detail::hash_state state
public const uint64_t seed

Method Overview

  • public llvm::hash_code combine(size_t length, char * buffer_ptr, char * buffer_end)
  • public template <typename T, typename... Ts>llvm::hash_code combine(size_t length, char * buffer_ptr, char * buffer_end, const T & arg, const Ts &... args)
  • public template <typename T>char * combine_data(size_t & length, char * buffer_ptr, char * buffer_end, T data)
  • public hash_combine_recursive_helper()

Methods

llvm::hash_code combine(size_t length,
                        char* buffer_ptr,
                        char* buffer_end)

Description

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.

Declared at: llvm/include/llvm/ADT/Hashing.h:566

Parameters

size_t length
char* buffer_ptr
char* buffer_end

template <typename T, typename... Ts>
llvm::hash_code combine(size_t length,
                        char* buffer_ptr,
                        char* buffer_end,
                        const T& arg,
                        const Ts&... args)

Description

Recursive, variadic combining method. This function recurses through each argument, combining that argument into a single hash.

Declared at: llvm/include/llvm/ADT/Hashing.h:553

Templates

T
Ts

Parameters

size_t length
char* buffer_ptr
char* buffer_end
const T& arg
const Ts&... args

template <typename T>
char* combine_data(size_t& length,
                   char* buffer_ptr,
                   char* buffer_end,
                   T data)

Description

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.

Declared at: llvm/include/llvm/ADT/Hashing.h:514

Templates

T

Parameters

size_t& length
char* buffer_ptr
char* buffer_end
T data

hash_combine_recursive_helper()

Description

Construct a recursive hash combining helper. This sets up the state for a recursive hash combine, including getting the seed and buffer setup.

Declared at: llvm/include/llvm/ADT/Hashing.h:504