Skip to content

Commit 6d82c61

Browse files
committed
[CHERI] Minor fixes to libc++ forward-merging discovered while updating cheriot-rtos.
1 parent d350098 commit 6d82c61

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

libcxx/include/__bit/rotate.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ template <__libcpp_unsigned_integer _Tp>
6161
}
6262

6363
#if __has_feature(capabilities)
64-
template<>
65-
_LIBCPP_HIDE_FROM_ABI constexpr inline unsigned __intcap rotl(unsigned __intcap __t, unsigned int __cnt) noexcept {
66-
// __builtin_cheri_address_set cannot be used in a constant expression (yet), so we return a null-derived integer.
67-
return std::rotl(static_cast<ptraddr_t>(__t), __cnt);
64+
template <>
65+
_LIBCPP_HIDE_FROM_ABI constexpr inline unsigned __intcap rotl(unsigned __intcap __t, int __cnt) noexcept {
66+
// __builtin_cheri_address_set cannot be used in a constant expression (yet), so we return a null-derived integer.
67+
return std::rotl(static_cast<ptraddr_t>(__t), __cnt);
6868
}
69-
#endif
69+
# endif
7070

7171
template <__libcpp_unsigned_integer _Tp>
7272
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, int __cnt) noexcept {

libcxx/include/__functional/hash.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,7 @@ template <>
435435
struct _LIBCPP_TEMPLATE_VIS hash<__intcap_t>
436436
: public __unary_function<__intcap_t, size_t>
437437
{
438-
_LIBCPP_INLINE_VISIBILITY
439-
size_t operator()(__intcap_t x) const _NOEXCEPT {
438+
_LIBCPP_HIDE_FROM_ABI size_t operator()(__intcap_t x) const _NOEXCEPT {
440439
return hash<ptraddr_t>()(static_cast<ptraddr_t>(x));
441440
}
442441
};
@@ -445,8 +444,7 @@ template <>
445444
struct _LIBCPP_TEMPLATE_VIS hash<__uintcap_t>
446445
: public __unary_function<__uintcap_t, size_t>
447446
{
448-
_LIBCPP_INLINE_VISIBILITY
449-
size_t operator()(__uintcap_t x) const _NOEXCEPT {
447+
_LIBCPP_HIDE_FROM_ABI size_t operator()(__uintcap_t x) const _NOEXCEPT {
450448
return hash<ptraddr_t>()(static_cast<ptraddr_t>(x));
451449
}
452450
};

libcxx/include/__utility/convert_to_integral.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __uint128_t __convert_to_integral
4949
#endif
5050

5151
#if __has_feature(capabilities)
52-
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
53-
__intcap __convert_to_integral(__intcap __val) { return __val; }
52+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __intcap __convert_to_integral(__intcap __val) { return __val; }
5453

55-
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
56-
unsigned __intcap __convert_to_integral(unsigned __intcap __val) { return __val; }
54+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unsigned __intcap __convert_to_integral(unsigned __intcap __val) {
55+
return __val;
56+
}
5757
#endif
5858

5959
template <class _Tp, bool = is_enum<_Tp>::value>

0 commit comments

Comments
 (0)