15 #ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H 16 #define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H 19 #include <type_traits> 31 : std::integral_constant<size_t, ConstantLog2<N / 2>::value + 1> {};
32 template <>
struct ConstantLog2<1> : std::integral_constant<size_t, 0> {};
36 static const bool value =
false;
42 static const bool value =
true;
50 static const bool value =
true;
73 enum { NumLowBitsAvailable = 2 };
81 return NonConst::getAsVoidPointer(P);
84 return NonConst::getFromVoidPointer(const_cast<void *>(P));
86 enum { NumLowBitsAvailable = NonConst::NumLowBitsAvailable };
94 return NonConst::getAsVoidPointer(const_cast<T *>(P));
97 return NonConst::getFromVoidPointer(const_cast<void *>(P));
99 enum { NumLowBitsAvailable = NonConst::NumLowBitsAvailable };
105 return reinterpret_cast<void *
>(
P);
108 return reinterpret_cast<uintptr_t
>(
P);
111 enum { NumLowBitsAvailable = 0 };
static void * getFromVoidPointer(void *P)
Compute iterated dominance frontiers using a linear time algorithm.
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
static uintptr_t getFromVoidPointer(void *P)
static const T getFromVoidPointer(const void *P)
PointerLikeTypeTraits< T * > NonConst
static const void * getAsVoidPointer(const T P)