diff options
Diffstat (limited to 'include/llvm/ADT/Hashing.h')
-rw-r--r-- | include/llvm/ADT/Hashing.h | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/include/llvm/ADT/Hashing.h b/include/llvm/ADT/Hashing.h index c3b574102f69..9f830baa4243 100644 --- a/include/llvm/ADT/Hashing.h +++ b/include/llvm/ADT/Hashing.h @@ -57,7 +57,7 @@ namespace llvm { -/// \brief An opaque object representing a hash code. +/// An opaque object representing a hash code. /// /// This object represents the result of hashing some entity. It is intended to /// be used to implement hashtables or other hashing-based data structures. @@ -73,14 +73,14 @@ class hash_code { size_t value; public: - /// \brief Default construct a hash_code. + /// Default construct a hash_code. /// Note that this leaves the value uninitialized. hash_code() = default; - /// \brief Form a hash code directly from a numerical value. + /// Form a hash code directly from a numerical value. hash_code(size_t value) : value(value) {} - /// \brief Convert the hash code to its numerical value for use. + /// Convert the hash code to its numerical value for use. /*explicit*/ operator size_t() const { return value; } friend bool operator==(const hash_code &lhs, const hash_code &rhs) { @@ -90,11 +90,11 @@ public: return lhs.value != rhs.value; } - /// \brief Allow a hash_code to be directly run through hash_value. + /// Allow a hash_code to be directly run through hash_value. friend size_t hash_value(const hash_code &code) { return code.value; } }; -/// \brief Compute a hash_code for any integer value. +/// Compute a hash_code for any integer value. /// /// Note that this function is intended to compute the same hash_code for /// a particular value without regard to the pre-promotion type. This is in @@ -105,21 +105,21 @@ template <typename T> typename std::enable_if<is_integral_or_enum<T>::value, hash_code>::type hash_value(T value); -/// \brief Compute a hash_code for a pointer's address. +/// Compute a hash_code for a pointer's address. /// /// N.B.: This hashes the *address*. Not the value and not the type. template <typename T> hash_code hash_value(const T *ptr); -/// \brief Compute a hash_code for a pair of objects. +/// Compute a hash_code for a pair of objects. template <typename T, typename U> hash_code hash_value(const std::pair<T, U> &arg); -/// \brief Compute a hash_code for a standard string. +/// Compute a hash_code for a standard string. template <typename T> hash_code hash_value(const std::basic_string<T> &arg); -/// \brief Override the execution seed with a fixed value. +/// Override the execution seed with a fixed value. /// /// This hashing library uses a per-execution seed designed to change on each /// run with high probability in order to ensure that the hash codes are not @@ -164,7 +164,7 @@ static const uint64_t k1 = 0xb492b66fbe98f273ULL; static const uint64_t k2 = 0x9ae16a3b2f90404fULL; static const uint64_t k3 = 0xc949d7c7509e6557ULL; -/// \brief Bitwise right rotate. +/// Bitwise right rotate. /// Normally this will compile to a single instruction, especially if the /// shift is a manifest constant. inline uint64_t rotate(uint64_t val, size_t shift) { @@ -254,13 +254,13 @@ inline uint64_t hash_short(const char *s, size_t length, uint64_t seed) { return k2 ^ seed; } -/// \brief The intermediate state used during hashing. +/// The intermediate state used during hashing. /// Currently, the algorithm for computing hash codes is based on CityHash and /// keeps 56 bytes of arbitrary state. struct hash_state { uint64_t h0, h1, h2, h3, h4, h5, h6; - /// \brief Create a new hash_state structure and initialize it based on the + /// 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. static hash_state create(const char *s, uint64_t seed) { @@ -272,7 +272,7 @@ struct hash_state { return state; } - /// \brief Mix 32-bytes from the input sequence into the 16-bytes of 'a' + /// Mix 32-bytes from the input sequence into the 16-bytes of 'a' /// and 'b', including whatever is already in 'a' and 'b'. static void mix_32_bytes(const char *s, uint64_t &a, uint64_t &b) { a += fetch64(s); @@ -284,7 +284,7 @@ struct hash_state { a += c; } - /// \brief Mix in a 64-byte buffer of data. + /// 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. void mix(const char *s) { @@ -302,7 +302,7 @@ struct hash_state { std::swap(h2, h0); } - /// \brief Compute the final 64-bit hash code value based on the current + /// Compute the final 64-bit hash code value based on the current /// state and the length of bytes hashed. uint64_t finalize(size_t length) { return hash_16_bytes(hash_16_bytes(h3, h5) + shift_mix(h1) * k1 + h2, @@ -311,7 +311,7 @@ struct hash_state { }; -/// \brief A global, fixed seed-override variable. +/// A global, fixed seed-override variable. /// /// This variable can be set using the \see llvm::set_fixed_execution_seed /// function. See that function for details. Do not, under any circumstances, @@ -332,7 +332,7 @@ inline size_t get_execution_seed() { } -/// \brief Trait to indicate whether a type's bits can be hashed directly. +/// Trait to indicate whether a type's bits can be hashed directly. /// /// A type trait which is true if we want to combine values for hashing by /// reading the underlying data. It is false if values of this type must @@ -359,14 +359,14 @@ template <typename T, typename U> struct is_hashable_data<std::pair<T, U> > (sizeof(T) + sizeof(U)) == sizeof(std::pair<T, U>))> {}; -/// \brief Helper to get the hashable data representation for a type. +/// Helper to get the hashable data representation for a type. /// This variant is enabled when the type itself can be used. template <typename T> typename std::enable_if<is_hashable_data<T>::value, T>::type get_hashable_data(const T &value) { return value; } -/// \brief Helper to get the hashable data representation for a type. +/// Helper to get the hashable data representation for a type. /// This variant is enabled when we must first call hash_value and use the /// result as our data. template <typename T> @@ -376,7 +376,7 @@ get_hashable_data(const T &value) { return hash_value(value); } -/// \brief Helper to store data from a value into a buffer and advance the +/// Helper to store data from a value into a buffer and advance the /// pointer into that buffer. /// /// This routine first checks whether there is enough space in the provided @@ -395,7 +395,7 @@ bool store_and_advance(char *&buffer_ptr, char *buffer_end, const T& value, return true; } -/// \brief Implement the combining of integral values into a hash_code. +/// Implement the combining of integral values into a hash_code. /// /// This overload is selected when the value type of the iterator is /// integral. Rather than computing a hash_code for each object and then @@ -435,7 +435,7 @@ hash_code hash_combine_range_impl(InputIteratorT first, InputIteratorT last) { return state.finalize(length); } -/// \brief Implement the combining of integral values into a hash_code. +/// 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 @@ -470,7 +470,7 @@ hash_combine_range_impl(ValueT *first, ValueT *last) { } // namespace hashing -/// \brief Compute a hash_code for a sequence of values. +/// Compute a hash_code for a sequence of values. /// /// This hashes a sequence of values. It produces the same hash_code as /// 'hash_combine(a, b, c, ...)', but can run over arbitrary sized sequences @@ -486,7 +486,7 @@ hash_code hash_combine_range(InputIteratorT first, InputIteratorT last) { namespace hashing { namespace detail { -/// \brief Helper class to manage the recursive combining of hash_combine +/// Helper class to manage the recursive combining of hash_combine /// arguments. /// /// This class exists to manage the state and various calls involved in the @@ -499,14 +499,14 @@ struct hash_combine_recursive_helper { const size_t seed; public: - /// \brief Construct a recursive hash combining helper. + /// Construct a recursive hash combining helper. /// /// This sets up the state for a recursive hash combine, including getting /// the seed and buffer setup. hash_combine_recursive_helper() : seed(get_execution_seed()) {} - /// \brief Combine one chunk of data into the current in-flight hash. + /// 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 @@ -547,7 +547,7 @@ public: return buffer_ptr; } - /// \brief Recursive, variadic combining method. + /// Recursive, variadic combining method. /// /// This function recurses through each argument, combining that argument /// into a single hash. @@ -560,7 +560,7 @@ public: return combine(length, buffer_ptr, buffer_end, args...); } - /// \brief Base case for recursive, variadic combining. + /// 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 @@ -588,7 +588,7 @@ public: } // namespace detail } // namespace hashing -/// \brief Combine values into a single hash_code. +/// Combine values into a single hash_code. /// /// This routine accepts a varying number of arguments of any type. It will /// attempt to combine them into a single hash_code. For user-defined types it @@ -610,7 +610,7 @@ template <typename ...Ts> hash_code hash_combine(const Ts &...args) { namespace hashing { namespace detail { -/// \brief Helper to hash the value of a single integer. +/// 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, |