LLVM 19.0.0git
Static Public Member Functions | Static Public Attributes | List of all members
llvm::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT > Struct Template Reference

Provide suitable custom traits struct for function pointers. More...

#include "llvm/Support/PointerLikeTypeTraits.h"

Inheritance diagram for llvm::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT >:
Inheritance graph
[legend]

Static Public Member Functions

static void * getAsVoidPointer (FunctionPointerT P)
 
static FunctionPointerT getFromVoidPointer (void *P)
 

Static Public Attributes

static constexpr int NumLowBitsAvailable
 

Detailed Description

template<int Alignment, typename FunctionPointerT>
struct llvm::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT >

Provide suitable custom traits struct for function pointers.

Function pointers can't be directly given these traits as functions can't have their alignment computed with alignof and we need different casting.

To rely on higher alignment for a specialized use, you can provide a customized form of this template explicitly with higher alignment, and potentially use alignment attributes on functions to satisfy that.

Definition at line 125 of file PointerLikeTypeTraits.h.

Member Function Documentation

◆ getAsVoidPointer()

template<int Alignment, typename FunctionPointerT >
static void * llvm::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT >::getAsVoidPointer ( FunctionPointerT  P)
inlinestatic

◆ getFromVoidPointer()

template<int Alignment, typename FunctionPointerT >
static FunctionPointerT llvm::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT >::getFromVoidPointer ( void *  P)
inlinestatic

Definition at line 134 of file PointerLikeTypeTraits.h.

References P.

Member Data Documentation

◆ NumLowBitsAvailable

template<int Alignment, typename FunctionPointerT >
constexpr int llvm::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT >::NumLowBitsAvailable
staticconstexpr
Initial value:
=
detail::ConstantLog2<Alignment>::value

Definition at line 126 of file PointerLikeTypeTraits.h.

Referenced by llvm::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT >::getAsVoidPointer().


The documentation for this struct was generated from the following file: