LLVM API Documentation

Public Member Functions | Public Attributes
llvm::hashing::detail::hash_combine_recursive_helper Struct Reference

Helper class to manage the recursive combining of hash_combine arguments. More...

#include <Hashing.h>

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

List of all members.

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 T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
hash_code combine (size_t length, char *buffer_ptr, char *buffer_end, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6)
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
hash_code combine (size_t length, char *buffer_ptr, char *buffer_end, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5)
template<typename T1 , typename T2 , typename T3 , typename T4 >
hash_code combine (size_t length, char *buffer_ptr, char *buffer_end, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4)
template<typename T1 , typename T2 , typename T3 >
hash_code combine (size_t length, char *buffer_ptr, char *buffer_end, const T1 &arg1, const T2 &arg2, const T3 &arg3)
template<typename T1 , typename T2 >
hash_code combine (size_t length, char *buffer_ptr, char *buffer_end, const T1 &arg1, const T2 &arg2)
template<typename T1 >
hash_code combine (size_t length, char *buffer_ptr, char *buffer_end, const T1 &arg1)
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 size_t seed

Detailed 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.

Definition at line 502 of file Hashing.h.


Constructor & Destructor Documentation

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 512 of file Hashing.h.


Member Function Documentation

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
hash_code llvm::hashing::detail::hash_combine_recursive_helper::combine ( size_t  length,
char *  buffer_ptr,
char *  buffer_end,
const T1 arg1,
const T2 &  arg2,
const T3 &  arg3,
const T4 &  arg4,
const T5 &  arg5,
const T6 &  arg6 
) [inline]

Definition at line 577 of file Hashing.h.

References combine_data(), and llvm::hashing::detail::get_hashable_data().

Referenced by combine(), and llvm::hash_combine().

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
hash_code llvm::hashing::detail::hash_combine_recursive_helper::combine ( size_t  length,
char *  buffer_ptr,
char *  buffer_end,
const T1 arg1,
const T2 &  arg2,
const T3 &  arg3,
const T4 &  arg4,
const T5 &  arg5 
) [inline]

Definition at line 584 of file Hashing.h.

References combine(), combine_data(), and llvm::hashing::detail::get_hashable_data().

template<typename T1 , typename T2 , typename T3 , typename T4 >
hash_code llvm::hashing::detail::hash_combine_recursive_helper::combine ( size_t  length,
char *  buffer_ptr,
char *  buffer_end,
const T1 arg1,
const T2 &  arg2,
const T3 &  arg3,
const T4 &  arg4 
) [inline]

Definition at line 591 of file Hashing.h.

References combine(), combine_data(), and llvm::hashing::detail::get_hashable_data().

template<typename T1 , typename T2 , typename T3 >
hash_code llvm::hashing::detail::hash_combine_recursive_helper::combine ( size_t  length,
char *  buffer_ptr,
char *  buffer_end,
const T1 arg1,
const T2 &  arg2,
const T3 &  arg3 
) [inline]

Definition at line 598 of file Hashing.h.

References combine(), combine_data(), and llvm::hashing::detail::get_hashable_data().

template<typename T1 , typename T2 >
hash_code llvm::hashing::detail::hash_combine_recursive_helper::combine ( size_t  length,
char *  buffer_ptr,
char *  buffer_end,
const T1 arg1,
const T2 &  arg2 
) [inline]

Definition at line 604 of file Hashing.h.

References combine(), combine_data(), and llvm::hashing::detail::get_hashable_data().

template<typename T1 >
hash_code llvm::hashing::detail::hash_combine_recursive_helper::combine ( size_t  length,
char *  buffer_ptr,
char *  buffer_end,
const T1 arg1 
) [inline]

Definition at line 610 of file Hashing.h.

References combine(), combine_data(), and llvm::hashing::detail::get_hashable_data().

hash_code llvm::hashing::detail::hash_combine_recursive_helper::combine ( size_t  length,
char *  buffer_ptr,
char *  buffer_end 
) [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 623 of file Hashing.h.

References buffer, llvm::hashing::detail::hash_state::finalize(), llvm::hashing::detail::hash_short(), llvm::hashing::detail::hash_state::mix(), llvm::hashing::detail::rotate(), seed, and state.

template<typename T >
char* llvm::hashing::detail::hash_combine_recursive_helper::combine_data ( size_t &  length,
char *  buffer_ptr,
char *  buffer_end,
T  data 
) [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 522 of file Hashing.h.

References buffer, llvm::hashing::detail::hash_state::create(), llvm::LibFunc::memcpy, llvm::hashing::detail::hash_state::mix(), seed, state, and llvm::hashing::detail::store_and_advance().

Referenced by combine().


Member Data Documentation

Definition at line 503 of file Hashing.h.

Referenced by combine(), combine_data(), and llvm::hash_combine().

Definition at line 505 of file Hashing.h.

Referenced by combine(), and combine_data().

Definition at line 504 of file Hashing.h.

Referenced by combine(), and combine_data().


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