diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/include/llvm/ADT/DenseMapInfo.h | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 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 03ef6ea0b0..98af8ca088 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 |