LLVM 19.0.0git
Public Types | Public Member Functions | List of all members
llvm::TypeSwitch< T, void > Class Template Reference

Specialization of TypeSwitch for void returning callables. More...

#include "llvm/ADT/TypeSwitch.h"

Inheritance diagram for llvm::TypeSwitch< T, void >:
Inheritance graph
[legend]

Public Types

using BaseT = detail::TypeSwitchBase< TypeSwitch< T, void >, T >
 

Public Member Functions

 TypeSwitch (TypeSwitch &&other)=default
 
template<typename CaseT , typename CallableT >
TypeSwitch< T, void > & Case (CallableT &&caseFn)
 Add a case on the given type.
 
template<typename CallableT >
void Default (CallableT &&defaultFn)
 As a default, invoke the given callable within the root value.
 
- Public Member Functions inherited from llvm::detail::TypeSwitchBase< TypeSwitch< T, void >, T >
 TypeSwitchBase (const T &value)
 
 TypeSwitchBase (TypeSwitchBase &&other)
 
 TypeSwitchBase (const TypeSwitchBase &)=delete
 TypeSwitchBase is not copyable.
 
 ~TypeSwitchBase ()=default
 
void operator= (const TypeSwitchBase &)=delete
 
void operator= (TypeSwitchBase &&other)=delete
 
LLVM_ATTRIBUTE_ALWAYS_INLINE LLVM_ATTRIBUTE_NODEBUG TypeSwitch< T, void > & Case (CallableT &&caseFn)
 Invoke a case on the derived class with multiple case types.
 
TypeSwitch< T, void > & Case (CallableT &&caseFn)
 Invoke a case on the derived class, inferring the type of the Case from the first input of the given callable.
 

Additional Inherited Members

- Protected Types inherited from llvm::detail::TypeSwitchBase< TypeSwitch< T, void >, T >
using has_dyn_cast_t = decltype(std::declval< ValueT & >().template dyn_cast< CastT >())
 Trait to check whether ValueT provides a 'dyn_cast' method with type CastT.
 
- Static Protected Member Functions inherited from llvm::detail::TypeSwitchBase< TypeSwitch< T, void >, T >
static decltype(auto) castValue (ValueT &&value, std::enable_if_t< is_detected< has_dyn_cast_t, ValueT, CastT >::value > *=nullptr)
 Attempt to dyn_cast the given value to CastT.
 
static decltype(auto) castValue (ValueT &&value, std::enable_if_t<!is_detected< has_dyn_cast_t, ValueT, CastT >::value > *=nullptr)
 Attempt to dyn_cast the given value to CastT.
 
- Protected Attributes inherited from llvm::detail::TypeSwitchBase< TypeSwitch< T, void >, T >
const T value
 The root value we are switching on.
 

Detailed Description

template<typename T>
class llvm::TypeSwitch< T, void >

Specialization of TypeSwitch for void returning callables.

Definition at line 153 of file TypeSwitch.h.

Member Typedef Documentation

◆ BaseT

template<typename T >
using llvm::TypeSwitch< T, void >::BaseT = detail::TypeSwitchBase<TypeSwitch<T, void>, T>

Definition at line 156 of file TypeSwitch.h.

Constructor & Destructor Documentation

◆ TypeSwitch()

template<typename T >
llvm::TypeSwitch< T, void >::TypeSwitch ( TypeSwitch< T, void > &&  other)
default

Member Function Documentation

◆ Case()

template<typename T >
template<typename CaseT , typename CallableT >
TypeSwitch< T, void > & llvm::TypeSwitch< T, void >::Case ( CallableT &&  caseFn)
inline

Add a case on the given type.

Definition at line 163 of file TypeSwitch.h.

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

◆ Default()

template<typename T >
template<typename CallableT >
void llvm::TypeSwitch< T, void >::Default ( CallableT &&  defaultFn)
inline

As a default, invoke the given callable within the root value.

Definition at line 176 of file TypeSwitch.h.

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


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