Skip to content

Commit cf65d27

Browse files
committed
[libc++][NFC] Rename _LIBCPP_NO_RTTI to _LIBCPP_HAS_NO_RTTI
Other macros that disable parts of the library are named `_LIBCPP_HAS_NO_WHATEVER`. Reviewed By: ldionne, Mordante, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D143164
1 parent e6975c4 commit cf65d27

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

libcxx/include/__config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
895895

896896
// Try to find out if RTTI is disabled.
897897
# if !defined(__cpp_rtti) || __cpp_rtti < 199711L
898-
# define _LIBCPP_NO_RTTI
898+
# define _LIBCPP_HAS_NO_RTTI
899899
# endif
900900

901901
# ifndef _LIBCPP_WEAK

libcxx/include/__functional/function.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ class __base<_Rp(_ArgTypes...)>
268268
virtual void destroy() _NOEXCEPT = 0;
269269
virtual void destroy_deallocate() _NOEXCEPT = 0;
270270
virtual _Rp operator()(_ArgTypes&& ...) = 0;
271-
#ifndef _LIBCPP_NO_RTTI
271+
#ifndef _LIBCPP_HAS_NO_RTTI
272272
virtual const void* target(const type_info&) const _NOEXCEPT = 0;
273273
virtual const std::type_info& target_type() const _NOEXCEPT = 0;
274-
#endif // _LIBCPP_NO_RTTI
274+
#endif // _LIBCPP_HAS_NO_RTTI
275275
};
276276

277277
// __func implements __base for a given functor type.
@@ -305,10 +305,10 @@ class __func<_Fp, _Alloc, _Rp(_ArgTypes...)>
305305
virtual void destroy() _NOEXCEPT;
306306
virtual void destroy_deallocate() _NOEXCEPT;
307307
virtual _Rp operator()(_ArgTypes&&... __arg);
308-
#ifndef _LIBCPP_NO_RTTI
308+
#ifndef _LIBCPP_HAS_NO_RTTI
309309
virtual const void* target(const type_info&) const _NOEXCEPT;
310310
virtual const std::type_info& target_type() const _NOEXCEPT;
311-
#endif // _LIBCPP_NO_RTTI
311+
#endif // _LIBCPP_HAS_NO_RTTI
312312
};
313313

314314
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
@@ -356,7 +356,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
356356
return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
357357
}
358358

359-
#ifndef _LIBCPP_NO_RTTI
359+
#ifndef _LIBCPP_HAS_NO_RTTI
360360

361361
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
362362
const void*
@@ -374,7 +374,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
374374
return typeid(_Fp);
375375
}
376376

377-
#endif // _LIBCPP_NO_RTTI
377+
#endif // _LIBCPP_HAS_NO_RTTI
378378

379379
// __value_func creates a value-type from a __func.
380380

@@ -553,7 +553,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
553553
_LIBCPP_INLINE_VISIBILITY
554554
explicit operator bool() const _NOEXCEPT { return __f_ != nullptr; }
555555

556-
#ifndef _LIBCPP_NO_RTTI
556+
#ifndef _LIBCPP_HAS_NO_RTTI
557557
_LIBCPP_INLINE_VISIBILITY
558558
const std::type_info& target_type() const _NOEXCEPT
559559
{
@@ -569,7 +569,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
569569
return nullptr;
570570
return (const _Tp*)__f_->target(typeid(_Tp));
571571
}
572-
#endif // _LIBCPP_NO_RTTI
572+
#endif // _LIBCPP_HAS_NO_RTTI
573573
};
574574

575575
// Storage for a functor object, to be used with __policy to manage copy and
@@ -616,7 +616,7 @@ struct __policy
616616
{
617617
static const _LIBCPP_CONSTEXPR __policy __policy_ = {nullptr, nullptr,
618618
true,
619-
#ifndef _LIBCPP_NO_RTTI
619+
#ifndef _LIBCPP_HAS_NO_RTTI
620620
&typeid(void)
621621
#else
622622
nullptr
@@ -642,7 +642,7 @@ struct __policy
642642
__choose_policy(/* is_small = */ false_type) {
643643
static const _LIBCPP_CONSTEXPR __policy __policy_ = {
644644
&__large_clone<_Fun>, &__large_destroy<_Fun>, false,
645-
#ifndef _LIBCPP_NO_RTTI
645+
#ifndef _LIBCPP_HAS_NO_RTTI
646646
&typeid(typename _Fun::_Target)
647647
#else
648648
nullptr
@@ -657,7 +657,7 @@ struct __policy
657657
{
658658
static const _LIBCPP_CONSTEXPR __policy __policy_ = {
659659
nullptr, nullptr, false,
660-
#ifndef _LIBCPP_NO_RTTI
660+
#ifndef _LIBCPP_HAS_NO_RTTI
661661
&typeid(typename _Fun::_Target)
662662
#else
663663
nullptr
@@ -861,7 +861,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
861861
return !__policy_->__is_null;
862862
}
863863

864-
#ifndef _LIBCPP_NO_RTTI
864+
#ifndef _LIBCPP_HAS_NO_RTTI
865865
_LIBCPP_INLINE_VISIBILITY
866866
const std::type_info& target_type() const _NOEXCEPT
867867
{
@@ -878,7 +878,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
878878
else
879879
return reinterpret_cast<const _Tp*>(&__buf_.__small);
880880
}
881-
#endif // _LIBCPP_NO_RTTI
881+
#endif // _LIBCPP_HAS_NO_RTTI
882882
};
883883

884884
#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME)
@@ -945,7 +945,7 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
945945
return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
946946
}
947947

948-
#ifndef _LIBCPP_NO_RTTI
948+
#ifndef _LIBCPP_HAS_NO_RTTI
949949
virtual const void* target(type_info const& __ti) const _NOEXCEPT {
950950
if (__ti == typeid(__func::__block_type))
951951
return &__f_;
@@ -955,7 +955,7 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
955955
virtual const std::type_info& target_type() const _NOEXCEPT {
956956
return typeid(__func::__block_type);
957957
}
958-
#endif // _LIBCPP_NO_RTTI
958+
#endif // _LIBCPP_HAS_NO_RTTI
959959
};
960960

961961
#endif // _LIBCPP_HAS_EXTENSION_BLOCKS
@@ -1056,12 +1056,12 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
10561056
// function invocation:
10571057
_Rp operator()(_ArgTypes...) const;
10581058

1059-
#ifndef _LIBCPP_NO_RTTI
1059+
#ifndef _LIBCPP_HAS_NO_RTTI
10601060
// function target access:
10611061
const std::type_info& target_type() const _NOEXCEPT;
10621062
template <typename _Tp> _Tp* target() _NOEXCEPT;
10631063
template <typename _Tp> const _Tp* target() const _NOEXCEPT;
1064-
#endif // _LIBCPP_NO_RTTI
1064+
#endif // _LIBCPP_HAS_NO_RTTI
10651065
};
10661066

10671067
#if _LIBCPP_STD_VER >= 17
@@ -1156,7 +1156,7 @@ function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
11561156
return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
11571157
}
11581158

1159-
#ifndef _LIBCPP_NO_RTTI
1159+
#ifndef _LIBCPP_HAS_NO_RTTI
11601160

11611161
template<class _Rp, class ..._ArgTypes>
11621162
const std::type_info&
@@ -1181,7 +1181,7 @@ function<_Rp(_ArgTypes...)>::target() const _NOEXCEPT
11811181
return __f_.template target<_Tp>();
11821182
}
11831183

1184-
#endif // _LIBCPP_NO_RTTI
1184+
#endif // _LIBCPP_HAS_NO_RTTI
11851185

11861186
template <class _Rp, class... _ArgTypes>
11871187
inline _LIBCPP_INLINE_VISIBILITY

libcxx/include/__memory/shared_ptr.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class __shared_ptr_pointer
219219
__shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
220220
: __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {}
221221

222-
#ifndef _LIBCPP_NO_RTTI
222+
#ifndef _LIBCPP_HAS_NO_RTTI
223223
const void* __get_deleter(const type_info&) const _NOEXCEPT override;
224224
#endif
225225

@@ -228,7 +228,7 @@ class __shared_ptr_pointer
228228
void __on_zero_shared_weak() _NOEXCEPT override;
229229
};
230230

231-
#ifndef _LIBCPP_NO_RTTI
231+
#ifndef _LIBCPP_HAS_NO_RTTI
232232

233233
template <class _Tp, class _Dp, class _Alloc>
234234
const void*
@@ -237,7 +237,7 @@ __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__get_deleter(const type_info& __t) cons
237237
return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : nullptr;
238238
}
239239

240-
#endif // _LIBCPP_NO_RTTI
240+
#endif // _LIBCPP_HAS_NO_RTTI
241241

242242
template <class _Tp, class _Dp, class _Alloc>
243243
void
@@ -858,7 +858,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
858858
}
859859
#endif
860860

861-
#ifndef _LIBCPP_NO_RTTI
861+
#ifndef _LIBCPP_HAS_NO_RTTI
862862
template <class _Dp>
863863
_LIBCPP_HIDE_FROM_ABI
864864
_Dp* __get_deleter() const _NOEXCEPT
@@ -867,7 +867,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
867867
? const_cast<void *>(__cntrl_->__get_deleter(typeid(_Dp)))
868868
: nullptr);
869869
}
870-
#endif // _LIBCPP_NO_RTTI
870+
#endif // _LIBCPP_HAS_NO_RTTI
871871

872872
template<class _Yp, class _CntrlBlk>
873873
_LIBCPP_HIDE_FROM_ABI
@@ -1465,7 +1465,7 @@ reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
14651465
typename shared_ptr<_Tp>::element_type*>(__r.get()));
14661466
}
14671467

1468-
#ifndef _LIBCPP_NO_RTTI
1468+
#ifndef _LIBCPP_HAS_NO_RTTI
14691469

14701470
template<class _Dp, class _Tp>
14711471
inline _LIBCPP_INLINE_VISIBILITY
@@ -1475,7 +1475,7 @@ get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT
14751475
return __p.template __get_deleter<_Dp>();
14761476
}
14771477

1478-
#endif // _LIBCPP_NO_RTTI
1478+
#endif // _LIBCPP_HAS_NO_RTTI
14791479

14801480
template<class _Tp>
14811481
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr

libcxx/include/any

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ namespace __any_imp
175175
inline _LIBCPP_INLINE_VISIBILITY
176176
bool __compare_typeid(type_info const* __id, const void* __fallback_id)
177177
{
178-
#if !defined(_LIBCPP_NO_RTTI)
178+
#if !defined(_LIBCPP_HAS_NO_RTTI)
179179
if (__id && *__id == typeid(_Tp))
180180
return true;
181181
#endif
@@ -294,7 +294,7 @@ public:
294294
_LIBCPP_INLINE_VISIBILITY
295295
bool has_value() const _NOEXCEPT { return __h_ != nullptr; }
296296

297-
#if !defined(_LIBCPP_NO_RTTI)
297+
#if !defined(_LIBCPP_HAS_NO_RTTI)
298298
_LIBCPP_INLINE_VISIBILITY
299299
const type_info & type() const _NOEXCEPT {
300300
if (__h_) {
@@ -426,7 +426,7 @@ namespace __any_imp
426426
_LIBCPP_INLINE_VISIBILITY
427427
static void* __type_info()
428428
{
429-
#if !defined(_LIBCPP_NO_RTTI)
429+
#if !defined(_LIBCPP_HAS_NO_RTTI)
430430
return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
431431
#else
432432
return nullptr;
@@ -514,7 +514,7 @@ namespace __any_imp
514514
_LIBCPP_INLINE_VISIBILITY
515515
static void* __type_info()
516516
{
517-
#if !defined(_LIBCPP_NO_RTTI)
517+
#if !defined(_LIBCPP_HAS_NO_RTTI)
518518
return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
519519
#else
520520
return nullptr;
@@ -680,7 +680,7 @@ any_cast(any * __any) _NOEXCEPT
680680
typedef add_pointer_t<_ValueType> _ReturnType;
681681
if (__any && __any->__h_) {
682682
void *__p = __any->__call(_Action::_Get, nullptr,
683-
#if !defined(_LIBCPP_NO_RTTI)
683+
#if !defined(_LIBCPP_HAS_NO_RTTI)
684684
&typeid(_ValueType),
685685
#else
686686
nullptr,

0 commit comments

Comments
 (0)