14#ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
15#define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
31 : std::integral_constant<size_t, ConstantLog2<N / 2>::value + 1> {};
32template <>
struct ConstantLog2<1> : std::integral_constant<size_t, 0> {};
36 static const bool value =
false;
60 static constexpr int NumLowBitsAvailable =
75 static constexpr int NumLowBitsAvailable = 2;
83 return NonConst::getAsVoidPointer(
P);
86 return NonConst::getFromVoidPointer(
const_cast<void *
>(
P));
88 static constexpr int NumLowBitsAvailable = NonConst::NumLowBitsAvailable;
96 return NonConst::getAsVoidPointer(
const_cast<T *
>(
P));
99 return NonConst::getFromVoidPointer(
const_cast<void *
>(
P));
101 static constexpr int NumLowBitsAvailable = NonConst::NumLowBitsAvailable;
107 return reinterpret_cast<void *
>(
P);
110 return reinterpret_cast<uintptr_t
>(
P);
113 static constexpr int NumLowBitsAvailable = 0;
124template <
int Alignment,
typename FunctionPo
interT>
129 assert((
reinterpret_cast<uintptr_t
>(
P) &
131 "Alignment not satisfied for an actual function pointer!");
132 return reinterpret_cast<void *
>(
P);
135 return reinterpret_cast<FunctionPointerT
>(
P);
146template <
typename ReturnT,
typename... ParamTs>
Given that RA is a live value
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This is an optimization pass for GlobalISel generic memory operations.
Provide suitable custom traits struct for function pointers.
static constexpr int NumLowBitsAvailable
static FunctionPointerT getFromVoidPointer(void *P)
static void * getAsVoidPointer(FunctionPointerT P)
static void * getAsVoidPointer(T *P)
static T * getFromVoidPointer(void *P)
static const void * getAsVoidPointer(const T P)
PointerLikeTypeTraits< T > NonConst
static const T getFromVoidPointer(const void *P)
static const T * getFromVoidPointer(const void *P)
static const void * getAsVoidPointer(const T *P)
PointerLikeTypeTraits< T * > NonConst
static void * getAsVoidPointer(uintptr_t P)
static uintptr_t getFromVoidPointer(void *P)
static void * getFromVoidPointer(void *P)
static void * getAsVoidPointer(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.