14#ifndef LLVM_ADT_DENSEMAPINFO_H
15#define LLVM_ADT_DENSEMAPINFO_H
49template<
typename T,
typename Enable =
void>
68 static constexpr uintptr_t Log2MaxAlign = 12;
71 uintptr_t Val =
static_cast<uintptr_t
>(-1);
73 return reinterpret_cast<T*
>(Val);
77 uintptr_t Val =
static_cast<uintptr_t
>(-2);
79 return reinterpret_cast<T*
>(Val);
83 return (
unsigned((uintptr_t)PtrVal) >> 4) ^
94 static unsigned getHashValue(
const char& Val) {
return Val * 37U; }
105 static unsigned getHashValue(
const unsigned char &Val) {
return Val * 37U; }
116 static unsigned getHashValue(
const unsigned short &Val) {
return Val * 37U; }
127 static unsigned getHashValue(
const unsigned& Val) {
return Val * 37U; }
140 return (
unsigned)(Val * 37UL);
154 return (
unsigned)(Val * 37ULL);
158 const unsigned long long&
RHS) {
175 static unsigned getHashValue(
const int& Val) {
return (
unsigned)(Val * 37U); }
185 return (1UL << (
sizeof(
long) * 8 - 1)) - 1UL;
191 return (
unsigned)(Val * 37UL);
201 static inline long long getEmptyKey() {
return 0x7fffffffffffffffLL; }
205 return (
unsigned)(Val * 37ULL);
209 const long long&
RHS) {
215template<
typename T,
typename U>
222 return std::make_pair(FirstInfo::getEmptyKey(),
223 SecondInfo::getEmptyKey());
227 return std::make_pair(FirstInfo::getTombstoneKey(),
228 SecondInfo::getTombstoneKey());
233 SecondInfo::getHashValue(PairVal.second));
241 SecondInfo::getHashValue(Second));
245 return FirstInfo::isEqual(
LHS.first,
RHS.first) &&
246 SecondInfo::isEqual(
LHS.second,
RHS.second);
262 template <
unsigned I>
264 using EltType = std::tuple_element_t<I, Tuple>;
265 std::integral_constant<
bool,
I + 1 ==
sizeof...(Ts)> atEnd;
268 getHashValueImpl<I + 1>(
values, atEnd));
271 template <
unsigned I>
277 std::integral_constant<
bool, 0 ==
sizeof...(Ts)> atEnd;
278 return getHashValueImpl<0>(
values, atEnd);
281 template <
unsigned I>
283 using EltType = std::tuple_element_t<I, Tuple>;
284 std::integral_constant<
bool,
I + 1 ==
sizeof...(Ts)> atEnd;
286 isEqualImpl<I + 1>(lhs, rhs, atEnd);
289 template <
unsigned I>
295 std::integral_constant<
bool, 0 ==
sizeof...(Ts)> atEnd;
296 return isEqualImpl<0>(lhs, rhs, atEnd);
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.
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
Implement std::hash so that hash_code can be used in STL containers.
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 unsigned getHashValuePiecewise(const T &First, const U &Second)
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 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...