diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/include/llvm/ADT/DenseMapInfo.h | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/include/llvm/ADT/DenseMapInfo.h')
-rw-r--r-- | contrib/libs/llvm12/include/llvm/ADT/DenseMapInfo.h | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/contrib/libs/llvm12/include/llvm/ADT/DenseMapInfo.h b/contrib/libs/llvm12/include/llvm/ADT/DenseMapInfo.h index 98af8ca088..03ef6ea0b0 100644 --- a/contrib/libs/llvm12/include/llvm/ADT/DenseMapInfo.h +++ b/contrib/libs/llvm12/include/llvm/ADT/DenseMapInfo.h @@ -20,8 +20,8 @@ #ifndef LLVM_ADT_DENSEMAPINFO_H #define LLVM_ADT_DENSEMAPINFO_H -#include "llvm/ADT/APInt.h" -#include "llvm/ADT/APSInt.h" +#include "llvm/ADT/APInt.h" +#include "llvm/ADT/APSInt.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Hashing.h" #include "llvm/ADT/StringRef.h" @@ -356,49 +356,49 @@ template <> struct DenseMapInfo<hash_code> { static bool isEqual(hash_code LHS, hash_code RHS) { return LHS == RHS; } }; -/// Provide DenseMapInfo for APInt. -template <> struct DenseMapInfo<APInt> { - static inline APInt getEmptyKey() { - APInt V(nullptr, 0); - V.U.VAL = 0; - return V; - } - - static inline APInt getTombstoneKey() { - APInt V(nullptr, 0); - V.U.VAL = 1; - return V; - } - - static unsigned getHashValue(const APInt &Key) { - return static_cast<unsigned>(hash_value(Key)); - } - - static bool isEqual(const APInt &LHS, const APInt &RHS) { - return LHS.getBitWidth() == RHS.getBitWidth() && LHS == RHS; - } -}; - -/// Provide DenseMapInfo for APSInt, using the DenseMapInfo for APInt. -template <> struct DenseMapInfo<APSInt> { - static inline APSInt getEmptyKey() { - return APSInt(DenseMapInfo<APInt>::getEmptyKey()); - } - - static inline APSInt getTombstoneKey() { - return APSInt(DenseMapInfo<APInt>::getTombstoneKey()); - } - - static unsigned getHashValue(const APSInt &Key) { - return static_cast<unsigned>(hash_value(Key)); - } - - static bool isEqual(const APSInt &LHS, const APSInt &RHS) { - return LHS.getBitWidth() == RHS.getBitWidth() && - LHS.isUnsigned() == RHS.isUnsigned() && LHS == RHS; - } -}; - +/// Provide DenseMapInfo for APInt. +template <> struct DenseMapInfo<APInt> { + static inline APInt getEmptyKey() { + APInt V(nullptr, 0); + V.U.VAL = 0; + return V; + } + + static inline APInt getTombstoneKey() { + APInt V(nullptr, 0); + V.U.VAL = 1; + return V; + } + + static unsigned getHashValue(const APInt &Key) { + return static_cast<unsigned>(hash_value(Key)); + } + + static bool isEqual(const APInt &LHS, const APInt &RHS) { + return LHS.getBitWidth() == RHS.getBitWidth() && LHS == RHS; + } +}; + +/// Provide DenseMapInfo for APSInt, using the DenseMapInfo for APInt. +template <> struct DenseMapInfo<APSInt> { + static inline APSInt getEmptyKey() { + return APSInt(DenseMapInfo<APInt>::getEmptyKey()); + } + + static inline APSInt getTombstoneKey() { + return APSInt(DenseMapInfo<APInt>::getTombstoneKey()); + } + + static unsigned getHashValue(const APSInt &Key) { + return static_cast<unsigned>(hash_value(Key)); + } + + static bool isEqual(const APSInt &LHS, const APSInt &RHS) { + return LHS.getBitWidth() == RHS.getBitWidth() && + LHS.isUnsigned() == RHS.isUnsigned() && LHS == RHS; + } +}; + } // end namespace llvm #endif // LLVM_ADT_DENSEMAPINFO_H |