reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

include/llvm/Support/Casting.h
   71     return isa_impl<To, From>::doit(Val);
   77     return isa_impl<To, From>::doit(Val);
   85     return isa_impl_cl<To, From>::doit(*Val);
  106     return isa_impl<To, From>::doit(*Val);
  122     return isa_impl_wrap<To, SimpleFrom,
  132     return isa_impl_cl<To,FromTy>::doit(Val);
  142   return isa_impl_wrap<X, const Y,
  153   return isa<X>(Val);
  165   using ret_type = To &;       // Normal case, return Ty&
  168   using ret_type = const To &; // Normal case, return Ty&
  172   using ret_type = To *;       // Pointer arg case, return Ty*
  176   using ret_type = const To *; // Constant pointer arg case, return const Ty*
  186   using PointerType = typename cast_retty_impl<To, From *>::ret_type;
  198   using ret_type = typename cast_retty<To, SimpleFrom>::ret_type;
  204   using ret_type = typename cast_retty_impl<To,FromTy>::ret_type;
  210       To, From, typename simplify_type<From>::SimpleType>::ret_type;
  227   static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) {
  228     typename cast_retty<To, FromTy>::ret_type Res2
  256 inline typename cast_retty<X, Y>::ret_type cast(Y &Val) {
  258   return cast_convert_val<X, Y,
  263 inline typename cast_retty<X, Y *>::ret_type cast(Y *Val) {
  265   return cast_convert_val<X, Y*,
  270 inline typename cast_retty<X, std::unique_ptr<Y>>::ret_type
  273   using ret_type = typename cast_retty<X, std::unique_ptr<Y>>::ret_type;
  275       cast_convert_val<X, Y *, typename simplify_type<Y *>::SimpleType>::doit(
  296                             typename cast_retty<X, Y>::ret_type>::type
  305 LLVM_NODISCARD inline typename cast_retty<X, Y *>::ret_type
  309   return cast<X>(Val);
  313 inline typename cast_retty<X, std::unique_ptr<Y>>::ret_type
  317   return cast<X>(std::move(Val));
  337 LLVM_NODISCARD inline typename cast_retty<X, Y>::ret_type dyn_cast(Y &Val) {
  342 LLVM_NODISCARD inline typename cast_retty<X, Y *>::ret_type dyn_cast(Y *Val) {
  343   return isa<X>(Val) ? cast<X>(Val) : nullptr;
  343   return isa<X>(Val) ? cast<X>(Val) : nullptr;
  360                             typename cast_retty<X, Y>::ret_type>::type
  366 LLVM_NODISCARD inline typename cast_retty<X, Y *>::ret_type
  368   return (Val && isa<X>(Val)) ? cast<X>(Val) : nullptr;
  368   return (Val && isa<X>(Val)) ? cast<X>(Val) : nullptr;
  378     -> decltype(cast<X>(Val)) {
  379   if (!isa<X>(Val))
  381   return cast<X>(std::move(Val));
  386     -> decltype(cast<X>(Val)) {
  387   return unique_dyn_cast<X, Y>(Val);
unittests/Support/Casting.cpp
   27   struct foo *baz();
   28   struct foo *caz();
   29   struct foo *daz();
   30   struct foo *naz();
   57 template <typename T> struct isa_impl<foo, T> {
   61 foo *bar::baz() {
   62     return cast<foo>(this);
   65 foo *bar::caz() {
   66     return cast_or_null<foo>(this);
   69 foo *bar::daz() {
   70     return dyn_cast<foo>(this);
   73 foo *bar::naz() {
   74     return dyn_cast_or_null<foo>(this);
   82   static SimpleType getSimplifiedValue(foo &Val) { return 0; }
   97 static_assert(std::is_same<simplify_type<foo>::SimpleType, int>::value,
   99 static_assert(std::is_same<simplify_type<foo *>::SimpleType, foo *>::value,
   99 static_assert(std::is_same<simplify_type<foo *>::SimpleType, foo *>::value,
  104 const foo *null_foo = nullptr;
  128   foo &F1 = cast<foo>(B1);
  128   foo &F1 = cast<foo>(B1);
  130   const foo *F3 = cast<foo>(B2);
  130   const foo *F3 = cast<foo>(B2);
  132   const foo *F4 = cast<foo>(B2);
  132   const foo *F4 = cast<foo>(B2);
  134   const foo &F5 = cast<foo>(B3);
  134   const foo &F5 = cast<foo>(B3);
  136   const foo *F6 = cast<foo>(B4);
  136   const foo *F6 = cast<foo>(B4);
  141   foo *F8 = B1.baz();
  145   auto FP = cast<foo>(std::move(BP));
  146   static_assert(std::is_same<std::unique_ptr<const foo>, decltype(FP)>::value,
  153   const foo *F11 = cast_or_null<foo>(B2);
  153   const foo *F11 = cast_or_null<foo>(B2);
  155   const foo *F12 = cast_or_null<foo>(B2);
  155   const foo *F12 = cast_or_null<foo>(B2);
  157   const foo *F13 = cast_or_null<foo>(B4);
  157   const foo *F13 = cast_or_null<foo>(B4);
  159   const foo *F14 = cast_or_null<foo>(fub());  // Shouldn't print.
  159   const foo *F14 = cast_or_null<foo>(fub());  // Shouldn't print.
  161   foo *F15 = B1.caz();
  165   auto FP = cast_or_null<foo>(std::move(BP));
  170   const foo *F1 = dyn_cast<foo>(B2);
  170   const foo *F1 = dyn_cast<foo>(B2);
  172   const foo *F2 = dyn_cast<foo>(B2);
  172   const foo *F2 = dyn_cast<foo>(B2);
  174   const foo *F3 = dyn_cast<foo>(B4);
  174   const foo *F3 = dyn_cast<foo>(B4);
  179   foo *F5 = B1.daz();
  184   const foo *F1 = dyn_cast_or_null<foo>(B2);
  184   const foo *F1 = dyn_cast_or_null<foo>(B2);
  186   const foo *F2 = dyn_cast_or_null<foo>(B2);
  186   const foo *F2 = dyn_cast_or_null<foo>(B2);
  188   const foo *F3 = dyn_cast_or_null<foo>(B4);
  188   const foo *F3 = dyn_cast_or_null<foo>(B4);
  190   foo *F4 = dyn_cast_or_null<foo>(fub());
  190   foo *F4 = dyn_cast_or_null<foo>(fub());
  192   foo *F5 = B1.naz();
  230   auto F = unique_dyn_cast<foo>(D);
  244   auto F2 = unique_dyn_cast<foo>(newb());
  313 IllegalCast *testIllegalCast() { return cast<foo>(pod()); }
usr/include/c++/7.4.0/bits/unique_ptr.h
   68         default_delete(const default_delete<_Up>&) noexcept { }
   72       operator()(_Tp* __ptr) const
   74 	static_assert(!is_void<_Tp>::value,
   76 	static_assert(sizeof(_Tp)>0,
  122 	  using type = _Up*;
  137       using pointer = typename _Ptr<_Tp, _Dp>::type;
  161 	typename __uniq_ptr_impl<_Tp, _Up>::_DeleterConstraint::type;
  163       __uniq_ptr_impl<_Tp, _Dp> _M_t;
  166       using pointer	  = typename __uniq_ptr_impl<_Tp, _Dp>::pointer;
  167       using element_type  = _Tp;
  252 	unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  694     operator==(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
usr/include/c++/7.4.0/type_traits
  215     : public __is_void_helper<typename remove_cv<_Tp>::type>::type
  581     : public __or_<is_lvalue_reference<_Tp>,
  582                    is_rvalue_reference<_Tp>>::type
  601     : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
  601     : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
  602                           is_void<_Tp>>>::type
  638     : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
  638     : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
 1554     { typedef _Tp     type; };
 1558     { typedef _Tp     type; };
 1563     { typedef _Tp     type; };
 1574       remove_const<typename remove_volatile<_Tp>::type>::type     type;
 1645     { typedef _Tp&   type; };
 1650     : public __add_lvalue_reference_helper<_Tp>
 1983     { typedef _Up     type; };
utils/unittest/googletest/include/gtest/gtest-printers.h
  407                     T* p, ::std::ostream* os) {
  416     if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {