LLVM  16.0.0git
Classes | Namespaces | Typedefs | Functions | Variables
Casting.h File Reference
#include "llvm/ADT/Optional.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/type_traits.h"
#include <cassert>
#include <memory>
#include <type_traits>
Include dependency graph for Casting.h:

Go to the source code of this file.

Classes

struct  llvm::simplify_type< From >
 Define a template that can be specialized by smart pointers to reflect the fact that they are automatically dereferenced, and are not involved with the template selection process... More...
 
struct  llvm::simplify_type< const From >
 
struct  llvm::isa_impl< To, From, Enabler >
 
struct  llvm::isa_impl< To, From, std::enable_if_t< std::is_base_of< To, From >::value > >
 
struct  llvm::isa_impl_cl< To, From >
 
struct  llvm::isa_impl_cl< To, const From >
 
struct  llvm::isa_impl_cl< To, const std::unique_ptr< From > >
 
struct  llvm::isa_impl_cl< To, From * >
 
struct  llvm::isa_impl_cl< To, From *const >
 
struct  llvm::isa_impl_cl< To, const From * >
 
struct  llvm::isa_impl_cl< To, const From *const >
 
struct  llvm::isa_impl_wrap< To, From, SimpleFrom >
 
struct  llvm::isa_impl_wrap< To, FromTy, FromTy >
 
struct  llvm::cast_retty< To, From >
 
struct  llvm::cast_retty_impl< To, From >
 
struct  llvm::cast_retty_impl< To, const From >
 
struct  llvm::cast_retty_impl< To, From * >
 
struct  llvm::cast_retty_impl< To, const From * >
 
struct  llvm::cast_retty_impl< To, const From *const >
 
struct  llvm::cast_retty_impl< To, std::unique_ptr< From > >
 
struct  llvm::cast_retty_wrap< To, From, SimpleFrom >
 
struct  llvm::cast_retty_wrap< To, FromTy, FromTy >
 
struct  llvm::cast_retty< To, From >
 
struct  llvm::cast_convert_val< To, From, SimpleFrom >
 
struct  llvm::cast_convert_val< To, FromTy, FromTy >
 
struct  llvm::cast_convert_val< To, FromTy *, FromTy * >
 
struct  llvm::is_simple_type< X >
 
struct  llvm::CastIsPossible< To, From, Enable >
 This struct provides a way to check if a given cast is possible. More...
 
struct  llvm::CastIsPossible< To, Optional< From > >
 
struct  llvm::CastIsPossible< To, From, std::enable_if_t< std::is_base_of< To, From >::value > >
 Upcasting (from derived to base) and casting from a type to itself should always be possible. More...
 
struct  llvm::NullableValueCastFailed< To >
 All of these cast traits are meant to be implementations for useful casts that users may want to use that are outside the standard behavior. More...
 
struct  llvm::DefaultDoCastIfPossible< To, From, Derived >
 This cast trait just provides the default implementation of doCastIfPossible to make CastInfo specializations more declarative. More...
 
struct  llvm::ValueFromPointerCast< To, From, Derived >
 This cast trait provides casting for the specific case of casting to a value-typed object from a pointer-typed object. More...
 
struct  llvm::UniquePtrCast< To, From, Derived >
 This cast trait provides std::unique_ptr casting. More...
 
struct  llvm::OptionalValueCast< To, From, Derived >
 This cast trait provides Optional<T> casting. More...
 
struct  llvm::ConstStrippingForwardingCast< To, From, ForwardTo >
 Provides a cast trait that strips const from types to make it easier to implement a const-version of a non-const cast. More...
 
struct  llvm::ForwardToPointerCast< To, From, ForwardTo >
 Provides a cast trait that uses a defined pointer to pointer cast as a base for reference-to-reference casts. More...
 
struct  llvm::CastInfo< To, From, Enable >
 This struct provides a method for customizing the way a cast is performed. More...
 
struct  llvm::CastInfo< To, From, std::enable_if_t<!is_simple_type< From >::value > >
 This struct provides an overload for CastInfo where From has simplify_type defined. More...
 
struct  llvm::CastInfo< To, std::unique_ptr< From > >
 Provide a CastInfo specialized for std::unique_ptr. More...
 
struct  llvm::CastInfo< To, Optional< From > >
 Provide a CastInfo specialized for Optional<From>. More...
 
struct  llvm::ValueIsPresent< T, Enable >
 ValueIsPresent provides a way to check if a value is, well, present. More...
 
struct  llvm::ValueIsPresent< Optional< T > >
 
struct  llvm::ValueIsPresent< T, std::enable_if_t< IsNullable< T > > >
 

Namespaces

 llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
 llvm::detail
 

Typedefs

template<typename OptionalDerived , typename Default >
using llvm::detail::SelfType = std::conditional_t< std::is_same< OptionalDerived, void >::value, Default, OptionalDerived >
 A helper to derive the type to use with Self for cast traits, when the provided CRTP derived type is allowed to be void. More...
 

Functions

template<typename To , typename From >
bool llvm::isa (const From &Val)
 isa<X> - Return true if the parameter to the template is an instance of one of the template type arguments. More...
 
template<typename First , typename Second , typename... Rest, typename From >
bool llvm::isa (const From &Val)
 
template<typename To , typename From >
decltype(auto) llvm::cast (const From &Val)
 cast<X> - Return the argument parameter cast to the specified type. More...
 
template<typename To , typename From >
decltype(auto) llvm::cast (From &Val)
 
template<typename To , typename From >
decltype(auto) llvm::cast (From *Val)
 
template<typename To , typename From >
decltype(auto) llvm::cast (std::unique_ptr< From > &&Val)
 
template<typename T >
bool llvm::detail::isPresent (const T &t)
 
template<typename T >
decltype(auto) llvm::detail::unwrapValue (T &t)
 
template<typename To , typename From >
decltype(auto) llvm::dyn_cast (const From &Val)
 dyn_cast<X> - Return the argument parameter cast to the specified type. More...
 
template<typename To , typename From >
decltype(auto) llvm::dyn_cast (From &Val)
 
template<typename To , typename From >
decltype(auto) llvm::dyn_cast (From *Val)
 
template<typename To , typename From >
decltype(auto) llvm::dyn_cast (std::unique_ptr< From > &&Val)
 
template<typename... X, class Y >
bool llvm::isa_and_present (const Y &Val)
 isa_and_present<X> - Functionally identical to isa, except that a null value is accepted. More...
 
template<typename... X, class Y >
bool llvm::isa_and_nonnull (const Y &Val)
 
template<class X , class Y >
auto llvm::cast_if_present (const Y &Val)
 cast_if_present<X> - Functionally identical to cast, except that a null value is accepted. More...
 
template<class X , class Y >
auto llvm::cast_if_present (Y &Val)
 
template<class X , class Y >
auto llvm::cast_if_present (Y *Val)
 
template<class X , class Y >
auto llvm::cast_if_present (std::unique_ptr< Y > &&Val)
 
template<class X , class Y >
auto llvm::cast_or_null (const Y &Val)
 
template<class X , class Y >
auto llvm::cast_or_null (Y &Val)
 
template<class X , class Y >
auto llvm::cast_or_null (Y *Val)
 
template<class X , class Y >
auto llvm::cast_or_null (std::unique_ptr< Y > &&Val)
 
template<class X , class Y >
auto llvm::dyn_cast_if_present (const Y &Val)
 dyn_cast_if_present<X> - Functionally identical to dyn_cast, except that a null (or none in the case of optionals) value is accepted. More...
 
template<class X , class Y >
auto llvm::dyn_cast_if_present (Y &Val)
 
template<class X , class Y >
auto llvm::dyn_cast_if_present (Y *Val)
 
template<class X , class Y >
auto llvm::dyn_cast_or_null (const Y &Val)
 
template<class X , class Y >
auto llvm::dyn_cast_or_null (Y &Val)
 
template<class X , class Y >
auto llvm::dyn_cast_or_null (Y *Val)
 
template<class X , class Y >
CastInfo< X, std::unique_ptr< Y > >::CastResultType llvm::unique_dyn_cast (std::unique_ptr< Y > &Val)
 unique_dyn_cast<X> - Given a unique_ptr<Y>, try to return a unique_ptr<X>, taking ownership of the input pointer iff isa<X>(Val) is true. More...
 
template<class X , class Y >
auto llvm::unique_dyn_cast (std::unique_ptr< Y > &&Val)
 
template<class X , class Y >
CastInfo< X, std::unique_ptr< Y > >::CastResultType llvm::unique_dyn_cast_or_null (std::unique_ptr< Y > &Val)
 
template<class X , class Y >
auto llvm::unique_dyn_cast_or_null (std::unique_ptr< Y > &&Val)
 

Variables

template<typename T >
constexpr bool llvm::IsNullable