15 #ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H 16 #define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H 20 #include <type_traits> 32 : std::integral_constant<size_t, ConstantLog2<N / 2>::value + 1> {};
33 template <>
struct ConstantLog2<1> : std::integral_constant<size_t, 0> {};
37 static const bool value =
false;
43 static const bool value =
true;
51 static const bool value =
true;
74 enum { NumLowBitsAvailable = 2 };
82 return NonConst::getAsVoidPointer(P);
85 return NonConst::getFromVoidPointer(const_cast<void *>(P));
87 enum { NumLowBitsAvailable = NonConst::NumLowBitsAvailable };
95 return NonConst::getAsVoidPointer(const_cast<T *>(P));
98 return NonConst::getFromVoidPointer(const_cast<void *>(P));
100 enum { NumLowBitsAvailable = NonConst::NumLowBitsAvailable };
106 return reinterpret_cast<void *
>(
P);
109 return reinterpret_cast<uintptr_t
>(
P);
112 enum { NumLowBitsAvailable = 0 };
123 template <
int Alignment,
typename FunctionPo
interT>
127 assert((reinterpret_cast<uintptr_t>(P) &
128 ~((uintptr_t)-1 << NumLowBitsAvailable)) == 0 &&
129 "Alignment not satisfied for an actual function pointer!");
130 return reinterpret_cast<void *
>(
P);
133 return reinterpret_cast<FunctionPointerT
>(
P);
144 template <
typename ReturnT,
typename... ParamTs>
static void * getFromVoidPointer(void *P)
This class represents lattice values for constants.
static void * getAsVoidPointer(FunctionPointerT P)
static void * getAsVoidPointer(void *P)
static void * getAsVoidPointer(uintptr_t P)
A tiny meta function to compute the log2 of a compile time constant.
A traits type that is used to handle pointer types and things that are just wrappers for pointers as ...
static void * getAsVoidPointer(T *P)
static const T * getFromVoidPointer(const void *P)
static const void * getAsVoidPointer(const T *P)
static T * getFromVoidPointer(void *P)
PointerLikeTypeTraits< T > NonConst
Provide suitable custom traits struct for function pointers.
static uintptr_t getFromVoidPointer(void *P)
static FunctionPointerT getFromVoidPointer(void *P)
static const T getFromVoidPointer(const void *P)
PointerLikeTypeTraits< T * > NonConst
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static const void * getAsVoidPointer(const T P)