diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2019-07-02 03:21:16 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2019-07-02 03:21:16 +0000 |
| commit | bd7f84a48243ec0f8f01406d0ca328e40c0bd7b5 (patch) | |
| tree | 5c7825bc7477f36e627192717ed20f7565fe2799 | |
| parent | 7ae536a1cedfa6095ab3c14ad876e076b6b17e9b (diff) | |
| download | bcm5719-llvm-bd7f84a48243ec0f8f01406d0ca328e40c0bd7b5.tar.gz bcm5719-llvm-bd7f84a48243ec0f8f01406d0ca328e40c0bd7b5.zip | |
Use new '__libcpp_is_constant_evaluated' call to remove an '#ifdef' from the bit code. NFC
llvm-svn: 364884
| -rw-r--r-- | libcxx/include/bit | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libcxx/include/bit b/libcxx/include/bit index 9c45edd47ee..dbf7f8ac6bd 100644 --- a/libcxx/include/bit +++ b/libcxx/include/bit @@ -201,7 +201,7 @@ using __bitop_unsigned_integer _LIBCPP_NODEBUG_TYPE = integral_constant<bool, // rotl template<class _Tp> -inline _LIBCPP_INLINE_VISIBILITY constexpr +_LIBCPP_INLINE_VISIBILITY constexpr enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp> rotl(_Tp __t, unsigned int __cnt) noexcept { @@ -362,11 +362,7 @@ ceil2(_Tp __t) noexcept { if (__t < 2) return 1; const unsigned __n = numeric_limits<_Tp>::digits - countl_zero((_Tp)(__t - 1u)); - -#ifndef _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED - if (!__builtin_is_constant_evaluated ()) - _LIBCPP_DEBUG_ASSERT( __n != numeric_limits<_Tp>::digits, "Bad input to ceil2" ); -#endif + _LIBCPP_DEBUG_ASSERT(__libcpp_is_constant_evaluated() || __n != numeric_limits<_Tp>::digits, "Bad input to ceil2"); if constexpr (sizeof(_Tp) >= sizeof(unsigned)) return _Tp{1} << __n; |

