14#ifndef LLVM_ADT_DENSEMAPINFO_H
15#define LLVM_ADT_DENSEMAPINFO_H
50template<
typename T,
typename Enable =
void>
69 static constexpr uintptr_t Log2MaxAlign = 12;
72 uintptr_t Val =
static_cast<uintptr_t
>(-1);
74 return reinterpret_cast<T*
>(Val);
78 uintptr_t Val =
static_cast<uintptr_t
>(-2);
80 return reinterpret_cast<T*
>(Val);
84 return (
unsigned((uintptr_t)PtrVal) >> 4) ^
95 static unsigned getHashValue(
const char& Val) {
return Val * 37U; }
106 static unsigned getHashValue(
const unsigned char &Val) {
return Val * 37U; }
117 static unsigned getHashValue(
const unsigned short &Val) {
return Val * 37U; }
128 static unsigned getHashValue(
const unsigned& Val) {
return Val * 37U; }
141 return (
unsigned)(Val * 37UL);
155 return (
unsigned)(Val * 37ULL);
159 const unsigned long long&
RHS) {
176 static unsigned getHashValue(
const int& Val) {
return (
unsigned)(Val * 37U); }
186 return (1UL << (
sizeof(
long) * 8 - 1)) - 1UL;
192 return (
unsigned)(Val * 37UL);
202 static inline long long getEmptyKey() {
return 0x7fffffffffffffffLL; }
206 return (
unsigned)(Val * 37ULL);
210 const long long&
RHS) {
216template<
typename T,
typename U>
223 return std::make_pair(FirstInfo::getEmptyKey(),
224 SecondInfo::getEmptyKey());
228 return std::make_pair(FirstInfo::getTombstoneKey(),
229 SecondInfo::getTombstoneKey());
234 SecondInfo::getHashValue(PairVal.second));
238 return FirstInfo::isEqual(
LHS.first,
RHS.first) &&
239 SecondInfo::isEqual(
LHS.second,
RHS.second);
255 template <
unsigned I>
257 using EltType = std::tuple_element_t<I, Tuple>;
258 std::integral_constant<
bool,
I + 1 ==
sizeof...(Ts)> atEnd;
261 getHashValueImpl<I + 1>(
values, atEnd));
264 template <
unsigned I>
270 std::integral_constant<
bool, 0 ==
sizeof...(Ts)> atEnd;
271 return getHashValueImpl<0>(
values, atEnd);
274 template <
unsigned I>
276 using EltType = std::tuple_element_t<I, Tuple>;
277 std::integral_constant<
bool,
I + 1 ==
sizeof...(Ts)> atEnd;
279 isEqualImpl<I + 1>(lhs, rhs, atEnd);
282 template <
unsigned I>
288 std::integral_constant<
bool, 0 ==
sizeof...(Ts)> atEnd;
289 return isEqualImpl<0>(lhs, rhs, atEnd);
296 using FirstT = std::variant_alternative_t<0, Variant>;
303 return Variant(std::in_place_index<0>,
309 [&Val](
auto &&Alternative) {
310 using T = std::decay_t<
decltype(Alternative)>;
Mark the given Function as meaning that it cannot be changed in any way mark any values that are used as this function s parameters or by its return values(according to Uses) live as well. void DeadArgumentEliminationPass
static unsigned combineHashValue(unsigned a, unsigned b)
Simplistic combination of 32-bit hash values into 32-bit hash values.
This is an optimization pass for GlobalISel generic memory operations.
static unsigned getHashValue(const T *PtrVal)
static T * getTombstoneKey()
static bool isEqual(const T *LHS, const T *RHS)
static bool isEqual(const char &LHS, const char &RHS)
static char getEmptyKey()
static unsigned getHashValue(const char &Val)
static char getTombstoneKey()
static int getTombstoneKey()
static bool isEqual(const int &LHS, const int &RHS)
static unsigned getHashValue(const int &Val)
static bool isEqual(const long &LHS, const long &RHS)
static long getEmptyKey()
static long getTombstoneKey()
static unsigned getHashValue(const long &Val)
static unsigned getHashValue(const long long &Val)
static bool isEqual(const long long &LHS, const long long &RHS)
static long long getEmptyKey()
static long long getTombstoneKey()
static bool isEqual(const short &LHS, const short &RHS)
static unsigned getHashValue(const short &Val)
static short getTombstoneKey()
static short getEmptyKey()
static Pair getEmptyKey()
static unsigned getHashValue(const Pair &PairVal)
static Pair getTombstoneKey()
static bool isEqual(const Pair &LHS, const Pair &RHS)
std::tuple< Ts... > Tuple
static unsigned getHashValueImpl(const Tuple &values, std::false_type)
static bool isEqualImpl(const Tuple &lhs, const Tuple &rhs, std::false_type)
static unsigned getHashValue(const std::tuple< Ts... > &values)
static Tuple getTombstoneKey()
static bool isEqualImpl(const Tuple &, const Tuple &, std::true_type)
static bool isEqual(const Tuple &lhs, const Tuple &rhs)
static unsigned getHashValueImpl(const Tuple &, std::true_type)
static Tuple getEmptyKey()
static Variant getEmptyKey()
std::variant< Ts... > Variant
static unsigned getHashValue(const Variant &Val)
static bool isEqual(const Variant &LHS, const Variant &RHS)
std::variant_alternative_t< 0, Variant > FirstT
static Variant getTombstoneKey()
static bool isEqual(const unsigned &LHS, const unsigned &RHS)
static unsigned getTombstoneKey()
static unsigned getEmptyKey()
static unsigned getHashValue(const unsigned &Val)
static bool isEqual(const unsigned char &LHS, const unsigned char &RHS)
static unsigned char getTombstoneKey()
static unsigned getHashValue(const unsigned char &Val)
static unsigned char getEmptyKey()
static bool isEqual(const unsigned long &LHS, const unsigned long &RHS)
static unsigned long getEmptyKey()
static unsigned getHashValue(const unsigned long &Val)
static unsigned long getTombstoneKey()
static unsigned long long getTombstoneKey()
static bool isEqual(const unsigned long long &LHS, const unsigned long long &RHS)
static unsigned long long getEmptyKey()
static unsigned getHashValue(const unsigned long long &Val)
static unsigned getHashValue(const unsigned short &Val)
static unsigned short getTombstoneKey()
static bool isEqual(const unsigned short &LHS, const unsigned short &RHS)
static unsigned short getEmptyKey()
An information struct used to provide DenseMap with the various necessary components for a given valu...