aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/c_global
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-09-08 13:46:02 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-09-08 19:29:12 +0100
commit4977507e329ee3ed410fc7338b9aaada81b68361 (patch)
tree18376f11588432775a9cb11726c27017f9d1c7d5 /libstdc++-v3/include/c_global
parent157236dbd621644b3cec50b6cf38811959f3e78c (diff)
downloadgcc-4977507e329ee3ed410fc7338b9aaada81b68361.zip
gcc-4977507e329ee3ed410fc7338b9aaada81b68361.tar.gz
gcc-4977507e329ee3ed410fc7338b9aaada81b68361.tar.bz2
libstdc++: Add always_inline attribute to std::byte operators
libstdc++-v3/ChangeLog: * include/c_global/cstddef (byte): Add always_inline attribute to all operator overloads. (to_integer): Add always_inline attribute.
Diffstat (limited to 'libstdc++-v3/include/c_global')
-rw-r--r--libstdc++-v3/include/c_global/cstddef13
1 files changed, 12 insertions, 1 deletions
diff --git a/libstdc++-v3/include/c_global/cstddef b/libstdc++-v3/include/c_global/cstddef
index 4970c2d..df2d88a 100644
--- a/libstdc++-v3/include/c_global/cstddef
+++ b/libstdc++-v3/include/c_global/cstddef
@@ -119,55 +119,66 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using __byte_op_t = typename __byte_operand<_IntegerType>::__type;
template<typename _IntegerType>
+ [[__gnu__::__always_inline__]]
constexpr __byte_op_t<_IntegerType>
operator<<(byte __b, _IntegerType __shift) noexcept
{ return (byte)(unsigned char)((unsigned)__b << __shift); }
template<typename _IntegerType>
+ [[__gnu__::__always_inline__]]
constexpr __byte_op_t<_IntegerType>
operator>>(byte __b, _IntegerType __shift) noexcept
{ return (byte)(unsigned char)((unsigned)__b >> __shift); }
+ [[__gnu__::__always_inline__]]
constexpr byte
operator|(byte __l, byte __r) noexcept
{ return (byte)(unsigned char)((unsigned)__l | (unsigned)__r); }
+ [[__gnu__::__always_inline__]]
constexpr byte
operator&(byte __l, byte __r) noexcept
{ return (byte)(unsigned char)((unsigned)__l & (unsigned)__r); }
+ [[__gnu__::__always_inline__]]
constexpr byte
operator^(byte __l, byte __r) noexcept
{ return (byte)(unsigned char)((unsigned)__l ^ (unsigned)__r); }
+ [[__gnu__::__always_inline__]]
constexpr byte
operator~(byte __b) noexcept
{ return (byte)(unsigned char)~(unsigned)__b; }
template<typename _IntegerType>
+ [[__gnu__::__always_inline__]]
constexpr __byte_op_t<_IntegerType>&
operator<<=(byte& __b, _IntegerType __shift) noexcept
{ return __b = __b << __shift; }
template<typename _IntegerType>
+ [[__gnu__::__always_inline__]]
constexpr __byte_op_t<_IntegerType>&
operator>>=(byte& __b, _IntegerType __shift) noexcept
{ return __b = __b >> __shift; }
+ [[__gnu__::__always_inline__]]
constexpr byte&
operator|=(byte& __l, byte __r) noexcept
{ return __l = __l | __r; }
+ [[__gnu__::__always_inline__]]
constexpr byte&
operator&=(byte& __l, byte __r) noexcept
{ return __l = __l & __r; }
+ [[__gnu__::__always_inline__]]
constexpr byte&
operator^=(byte& __l, byte __r) noexcept
{ return __l = __l ^ __r; }
template<typename _IntegerType>
- [[nodiscard]]
+ [[nodiscard,__gnu__::__always_inline__]]
constexpr _IntegerType
to_integer(__byte_op_t<_IntegerType> __b) noexcept
{ return _IntegerType(__b); }