LLVM 20.0.0git
Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
llvm::detail::TypeSwitchBase< DerivedT, T > Class Template Reference

#include "llvm/ADT/TypeSwitch.h"

Inheritance diagram for llvm::detail::TypeSwitchBase< DerivedT, T >:
Inheritance graph
[legend]

Public Member Functions

 TypeSwitchBase (const T &value)
 
 TypeSwitchBase (TypeSwitchBase &&other)
 
 ~TypeSwitchBase ()=default
 
 TypeSwitchBase (const TypeSwitchBase &)=delete
 TypeSwitchBase is not copyable.
 
void operator= (const TypeSwitchBase &)=delete
 
void operator= (TypeSwitchBase &&other)=delete
 
template<typename CaseT , typename CaseT2 , typename... CaseTs, typename CallableT >
LLVM_ATTRIBUTE_ALWAYS_INLINE LLVM_ATTRIBUTE_NODEBUG DerivedT & Case (CallableT &&caseFn)
 Invoke a case on the derived class with multiple case types.
 
template<typename CallableT >
DerivedT & Case (CallableT &&caseFn)
 Invoke a case on the derived class, inferring the type of the Case from the first input of the given callable.
 

Static Protected Member Functions

template<typename CastT , typename ValueT >
static decltype(auto) castValue (ValueT &&value)
 Attempt to dyn_cast the given value to CastT.
 

Protected Attributes

const T value
 The root value we are switching on.
 

Detailed Description

template<typename DerivedT, typename T>
class llvm::detail::TypeSwitchBase< DerivedT, T >

Definition at line 25 of file TypeSwitch.h.

Constructor & Destructor Documentation

◆ TypeSwitchBase() [1/3]

template<typename DerivedT , typename T >
llvm::detail::TypeSwitchBase< DerivedT, T >::TypeSwitchBase ( const T value)
inline

Definition at line 27 of file TypeSwitch.h.

◆ TypeSwitchBase() [2/3]

template<typename DerivedT , typename T >
llvm::detail::TypeSwitchBase< DerivedT, T >::TypeSwitchBase ( TypeSwitchBase< DerivedT, T > &&  other)
inline

Definition at line 28 of file TypeSwitch.h.

◆ ~TypeSwitchBase()

template<typename DerivedT , typename T >
llvm::detail::TypeSwitchBase< DerivedT, T >::~TypeSwitchBase ( )
default

◆ TypeSwitchBase() [3/3]

template<typename DerivedT , typename T >
llvm::detail::TypeSwitchBase< DerivedT, T >::TypeSwitchBase ( const TypeSwitchBase< DerivedT, T > &  )
delete

TypeSwitchBase is not copyable.

Member Function Documentation

◆ Case() [1/2]

template<typename DerivedT , typename T >
template<typename CaseT , typename CaseT2 , typename... CaseTs, typename CallableT >
LLVM_ATTRIBUTE_ALWAYS_INLINE LLVM_ATTRIBUTE_NODEBUG DerivedT & llvm::detail::TypeSwitchBase< DerivedT, T >::Case ( CallableT &&  caseFn)
inline

Invoke a case on the derived class with multiple case types.

Definition at line 44 of file TypeSwitch.h.

References llvm::detail::TypeSwitchBase< DerivedT, T >::Case().

Referenced by llvm::detail::TypeSwitchBase< DerivedT, T >::Case().

◆ Case() [2/2]

template<typename DerivedT , typename T >
template<typename CallableT >
DerivedT & llvm::detail::TypeSwitchBase< DerivedT, T >::Case ( CallableT &&  caseFn)
inline

Invoke a case on the derived class, inferring the type of the Case from the first input of the given callable.

Note: This inference rules for this overload are very simple: strip pointers and references.

Definition at line 54 of file TypeSwitch.h.

◆ castValue()

template<typename DerivedT , typename T >
template<typename CastT , typename ValueT >
static decltype(auto) llvm::detail::TypeSwitchBase< DerivedT, T >::castValue ( ValueT &&  value)
inlinestaticprotected

Attempt to dyn_cast the given value to CastT.

Definition at line 66 of file TypeSwitch.h.

References llvm::detail::TypeSwitchBase< DerivedT, T >::value.

◆ operator=() [1/2]

template<typename DerivedT , typename T >
void llvm::detail::TypeSwitchBase< DerivedT, T >::operator= ( const TypeSwitchBase< DerivedT, T > &  )
delete

◆ operator=() [2/2]

template<typename DerivedT , typename T >
void llvm::detail::TypeSwitchBase< DerivedT, T >::operator= ( TypeSwitchBase< DerivedT, T > &&  other)
delete

Member Data Documentation

◆ value

template<typename DerivedT , typename T >
const T llvm::detail::TypeSwitchBase< DerivedT, T >::value
protected

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