LLVM 20.0.0git
|
#include "llvm/ADT/FunctionExtras.h"
Classes | |
struct | CallbacksHolder |
struct | CallbacksHolder< CallableT, CalledAs, EnableIfTrivial< CallableT > > |
struct | CalledAs |
struct | IsSizeLessThanThresholdT |
Public Member Functions | |
operator bool () const | |
Protected Member Functions | |
NonTrivialCallbacks * | getNonTrivialCallbacks () const |
CallPtrT | getCallPtr () const |
void * | getCalleePtr () const |
void * | getInlineStorage () const |
void * | getOutOfLineStorage () const |
size_t | getOutOfLineStorageSize () const |
size_t | getOutOfLineStorageAlignment () const |
void | setOutOfLineStorage (void *Ptr, size_t Size, size_t Alignment) |
template<typename CallableT , typename CalledAsT > | |
UniqueFunctionBase (CallableT Callable, CalledAs< CalledAsT >) | |
~UniqueFunctionBase () | |
UniqueFunctionBase (UniqueFunctionBase &&RHS) noexcept | |
UniqueFunctionBase & | operator= (UniqueFunctionBase &&RHS) noexcept |
UniqueFunctionBase ()=default | |
Static Protected Member Functions | |
template<typename CalledAsT > | |
static ReturnT | CallImpl (void *CallableAddr, AdjustedParamT< ParamTs >... Params) |
template<typename CallableT > | |
static void | MoveImpl (void *LHSCallableAddr, void *RHSCallableAddr) noexcept |
template<typename CallableT > | |
static void | DestroyImpl (void *CallableAddr) noexcept |
Protected Attributes | |
template<typename T > | |
struct IsSizeLessThanThresholdT< T, std::enable_if_t< sizeof(T)<=2 *sizeof(void *)> > :std::true_type {};template< typename T > struct AdjustedParamTBase { static_assert(!std::is_reference< T >::value, "references should be handled by template specialization");using type=std::conditional_t< std::is_trivially_copy_constructible< T >::value &&std::is_trivially_move_constructible< T >::value &&IsSizeLessThanThresholdT< T >::value, T, T & >;};template< typename T > struct AdjustedParamTBase< T & > { using type=T &;};template< typename T > struct AdjustedParamTBase< T && > { using type=T &;};template< typename T > using AdjustedParamT=typename AdjustedParamTBase< T >::type;using CallPtrT=ReturnT(*)(void *CallableAddr, AdjustedParamT< ParamTs >... Params);using MovePtrT=void(*)(void *LHSCallableAddr, void *RHSCallableAddr);using DestroyPtrT=void(*)(void *CallableAddr);struct alignas(8) TrivialCallback { CallPtrT CallPtr;};struct alignas(8) NonTrivialCallbacks { CallPtrT CallPtr;MovePtrT MovePtr;DestroyPtrT DestroyPtr;};using CallbackPointerUnionT=PointerUnion< TrivialCallback *, NonTrivialCallbacks * >;union StorageUnionT { struct OutOfLineStorageT { void *StoragePtr;size_t Size;size_t Alignment;} OutOfLineStorage;static_assert(sizeof(OutOfLineStorageT)<=InlineStorageSize, "Should always use all of the out-of-line storage for inline storage!");alignas(void *) mutable std::byte InlineStorage[InlineStorageSize];} StorageUnion;PointerIntPair< CallbackPointerUnionT, 1, bool > CallbackAndInlineFlag;bool isInlineStorage() const { return CallbackAndInlineFlag.getInt();} bool isTrivialCallback() const { return isa< TrivialCallback * >(CallbackAndInlineFlag.getPointer());} CallPtrT getTrivialCallback() const { return cast< TrivialCallback * >(CallbackAndInlineFlag.getPointer()) -> | CallPtr |
Static Protected Attributes | |
static constexpr size_t | InlineStorageSize = sizeof(void *) * 3 |
Definition at line 80 of file FunctionExtras.h.
|
inlineprotected |
Definition at line 261 of file FunctionExtras.h.
References llvm::allocate_buffer(), llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::getInlineStorage(), llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::InlineStorageSize, llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::setOutOfLineStorage(), and Size.
|
inlineprotected |
Definition at line 281 of file FunctionExtras.h.
References llvm::deallocate_buffer(), llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::getInlineStorage(), llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::getNonTrivialCallbacks(), llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::getOutOfLineStorage(), llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::getOutOfLineStorageAlignment(), and llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::getOutOfLineStorageSize().
Referenced by llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::operator=().
|
inlineprotectednoexcept |
|
protecteddefault |
|
inlinestaticprotected |
Definition at line 217 of file FunctionExtras.h.
|
inlinestaticprotectednoexcept |
Definition at line 230 of file FunctionExtras.h.
|
inlineprotected |
Definition at line 197 of file FunctionExtras.h.
References llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::getInlineStorage(), and llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::getOutOfLineStorage().
|
inlineprotected |
Definition at line 186 of file FunctionExtras.h.
References llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::getNonTrivialCallbacks().
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Definition at line 201 of file FunctionExtras.h.
Referenced by llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::getCalleePtr(), and llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::~UniqueFunctionBase().
|
inlineprotected |
Definition at line 208 of file FunctionExtras.h.
Referenced by llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::~UniqueFunctionBase().
|
inlineprotected |
Definition at line 205 of file FunctionExtras.h.
Referenced by llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::~UniqueFunctionBase().
|
inlinestaticprotectednoexcept |
Definition at line 224 of file FunctionExtras.h.
|
inlineexplicit |
Definition at line 343 of file FunctionExtras.h.
|
inlineprotectednoexcept |
Definition at line 328 of file FunctionExtras.h.
References RHS, llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::UniqueFunctionBase(), and llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::~UniqueFunctionBase().
|
inlineprotected |
Definition at line 212 of file FunctionExtras.h.
Referenced by llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::UniqueFunctionBase().
|
protected |
Definition at line 179 of file FunctionExtras.h.
|
staticconstexprprotected |
Definition at line 82 of file FunctionExtras.h.
Referenced by llvm::detail::UniqueFunctionBase< ReturnT, ParamTs >::UniqueFunctionBase().