15 #ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
16 #define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
18 #include "llvm/Support/DataTypes.h"
19 #include <type_traits>
35 : std::integral_constant<size_t, ConstantLog2<N / 2>::value + 1> {};
36 template <>
struct ConstantLog2<1> : std::integral_constant<size_t, 0> {};
60 enum { NumLowBitsAvailable = 2 };
69 return NonConst::getAsVoidPointer(const_cast<T *>(P));
72 return NonConst::getFromVoidPointer(const_cast<void *>(P));
74 enum { NumLowBitsAvailable = NonConst::NumLowBitsAvailable };
81 return reinterpret_cast<void *
>(
P);
84 return reinterpret_cast<uintptr_t
>(
P);
87 enum { NumLowBitsAvailable = 0 };
static T * getFromVoidPointer(void *P)
static void * getAsVoidPointer(T *P)
static void * getFromVoidPointer(void *P)
A traits type that is used to handle pointer types and things that are just wrappers for pointers as ...
A tiny meta function to compute the log2 of a compile time constant.
static const T * getFromVoidPointer(const void *P)
static void * getAsVoidPointer(uintptr_t P)
static void * getAsVoidPointer(void *P)
static uintptr_t getFromVoidPointer(void *P)
static const void * getAsVoidPointer(const T *P)