Shuffle Q_(ALWAYS|NEVER)_INLINE around so they can be attributes
The attribute must appear before the modifiers like 'inline' and 'constexpr'. Change-Id: If3d143fc2f85a8eba6e3ac2ceca10720649f33cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
d2d74673f3
commit
2a7fa4963c
@ -835,7 +835,7 @@ size_t simdSwapLoop(const uchar *, size_t, uchar *) noexcept
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename T> static Q_ALWAYS_INLINE
|
||||
template <typename T> Q_ALWAYS_INLINE static
|
||||
void *bswapLoop(const uchar *src, size_t n, uchar *dst) noexcept
|
||||
{
|
||||
// Buffers cannot partially overlap: either they're identical or totally
|
||||
|
@ -81,7 +81,7 @@ struct QPropertyBindingDataPointer
|
||||
d = reinterpret_cast<quintptr>(observer);
|
||||
}
|
||||
static void fixupAfterMove(QtPrivate::QPropertyBindingData *ptr);
|
||||
void Q_ALWAYS_INLINE addObserver(QPropertyObserver *observer);
|
||||
Q_ALWAYS_INLINE void addObserver(QPropertyObserver *observer);
|
||||
inline void setFirstObserver(QPropertyObserver *observer);
|
||||
inline QPropertyObserverPointer firstObserver() const;
|
||||
static QPropertyProxyBindingData *proxyData(QtPrivate::QPropertyBindingData *ptr);
|
||||
@ -399,7 +399,7 @@ public:
|
||||
|
||||
bool evaluateRecursive(PendingBindingObserverList &bindingObservers, QBindingStatus *status = nullptr);
|
||||
|
||||
bool Q_ALWAYS_INLINE evaluateRecursive_inline(PendingBindingObserverList &bindingObservers, QBindingStatus *status);
|
||||
Q_ALWAYS_INLINE bool evaluateRecursive_inline(PendingBindingObserverList &bindingObservers, QBindingStatus *status);
|
||||
|
||||
void notifyNonRecursive(const PendingBindingObserverList &bindingObservers);
|
||||
enum NotificationState : bool { Delayed, Sent };
|
||||
|
@ -107,7 +107,7 @@ static QString encodeTag(const QCborContainerPrivate *d)
|
||||
return s;
|
||||
}
|
||||
|
||||
static Q_NEVER_INLINE QString makeString(const QCborContainerPrivate *d, qsizetype idx,
|
||||
Q_NEVER_INLINE static QString makeString(const QCborContainerPrivate *d, qsizetype idx,
|
||||
ConversionMode mode)
|
||||
{
|
||||
const auto &e = d->elements.at(idx);
|
||||
|
@ -200,7 +200,7 @@ public:
|
||||
inline constexpr QAnyStringView(QLatin1StringView str) noexcept;
|
||||
|
||||
template <typename Container, if_compatible_container<Container> = true>
|
||||
constexpr Q_ALWAYS_INLINE QAnyStringView(const Container &c) noexcept
|
||||
Q_ALWAYS_INLINE constexpr QAnyStringView(const Container &c) noexcept
|
||||
: QAnyStringView(std::data(c), QtPrivate::lengthHelperContainer(c)) {}
|
||||
|
||||
template <typename Container, if_convertible_to<QString, Container> = true>
|
||||
|
@ -474,7 +474,7 @@ QSimpleParsedNumber<qlonglong> qstrntoll(const char *begin, qsizetype size, int
|
||||
}
|
||||
|
||||
template <typename Char>
|
||||
static Q_ALWAYS_INLINE void qulltoString_helper(qulonglong number, int base, Char *&p)
|
||||
Q_ALWAYS_INLINE static void qulltoString_helper(qulonglong number, int base, Char *&p)
|
||||
{
|
||||
// Performance-optimized code. Compiler can generate faster code when base is known.
|
||||
switch (base) {
|
||||
|
@ -372,7 +372,7 @@ static constexpr bool UseAvx2 = UseSse4_1 &&
|
||||
(qCompilerCpuFeatures & CpuFeatureArchHaswell) == CpuFeatureArchHaswell;
|
||||
|
||||
[[maybe_unused]]
|
||||
static Q_ALWAYS_INLINE __m128i mm_load8_zero_extend(const void *ptr)
|
||||
Q_ALWAYS_INLINE static __m128i mm_load8_zero_extend(const void *ptr)
|
||||
{
|
||||
const __m128i *dataptr = static_cast<const __m128i *>(ptr);
|
||||
if constexpr (UseSse4_1) {
|
||||
|
@ -129,7 +129,7 @@ namespace QtPrivate {
|
||||
[[nodiscard]] Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isLatin1(QStringView s) noexcept;
|
||||
[[nodiscard]] Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isValidUtf16(QStringView s) noexcept;
|
||||
|
||||
template <typename Char, size_t N> [[nodiscard]] constexpr Q_ALWAYS_INLINE
|
||||
template <typename Char, size_t N> [[nodiscard]] Q_ALWAYS_INLINE constexpr
|
||||
qsizetype lengthHelperContainerLoop(const Char (&str)[N])
|
||||
{
|
||||
#if defined(__cpp_lib_constexpr_algorithms) && defined(Q_CC_GNU_ONLY)
|
||||
@ -148,7 +148,7 @@ qsizetype lengthHelperContainerLoop(const Char (&str)[N])
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename Char, size_t N> [[nodiscard]] constexpr Q_ALWAYS_INLINE
|
||||
template <typename Char, size_t N> [[nodiscard]] Q_ALWAYS_INLINE constexpr
|
||||
std::enable_if_t<sizeof(Char) == sizeof(char16_t), qsizetype>
|
||||
lengthHelperContainer(const Char (&str)[N])
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ enum { Endian = 0, Data = 1 };
|
||||
static const uchar utf8bom[] = { 0xef, 0xbb, 0xbf };
|
||||
|
||||
#if defined(__SSE2__) || defined(__ARM_NEON__)
|
||||
static Q_ALWAYS_INLINE uint qBitScanReverse(unsigned v) noexcept
|
||||
Q_ALWAYS_INLINE static uint qBitScanReverse(unsigned v) noexcept
|
||||
{
|
||||
#if defined(__cpp_lib_int_pow2) && __cpp_lib_int_pow2 >= 202002L
|
||||
return std::bit_width(v) - 1;
|
||||
@ -80,7 +80,7 @@ static Q_ALWAYS_INLINE uint qBitScanReverse(unsigned v) noexcept
|
||||
#endif
|
||||
|
||||
#if defined(__SSE2__)
|
||||
template <QCpuFeatureType Cpu = _compilerCpuFeatures> static Q_ALWAYS_INLINE bool
|
||||
template <QCpuFeatureType Cpu = _compilerCpuFeatures> Q_ALWAYS_INLINE static bool
|
||||
simdEncodeAscii(uchar *&dst, const char16_t *&nextAscii, const char16_t *&src, const char16_t *end)
|
||||
{
|
||||
size_t sizeBytes = reinterpret_cast<const char *>(end) - reinterpret_cast<const char *>(src);
|
||||
@ -247,7 +247,7 @@ simdEncodeAscii(uchar *&dst, const char16_t *&nextAscii, const char16_t *&src, c
|
||||
return src == end;
|
||||
}
|
||||
|
||||
template <QCpuFeatureType Cpu = _compilerCpuFeatures> static Q_ALWAYS_INLINE bool
|
||||
template <QCpuFeatureType Cpu = _compilerCpuFeatures> Q_ALWAYS_INLINE static bool
|
||||
simdDecodeAscii(char16_t *&dst, const uchar *&nextAscii, const uchar *&src, const uchar *end)
|
||||
{
|
||||
// do sixteen characters at a time
|
||||
|
@ -25,7 +25,7 @@ using QStringPrivate = QArrayDataPointer<char16_t>;
|
||||
|
||||
namespace QtPrivate {
|
||||
template <qsizetype N>
|
||||
static Q_ALWAYS_INLINE QStringPrivate qMakeStringPrivate(const char16_t (&literal)[N])
|
||||
Q_ALWAYS_INLINE static QStringPrivate qMakeStringPrivate(const char16_t (&literal)[N])
|
||||
{
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast)
|
||||
auto str = const_cast<char16_t *>(literal);
|
||||
|
@ -166,7 +166,7 @@ public:
|
||||
#endif
|
||||
|
||||
template <typename Container, if_compatible_container<Container> = true>
|
||||
constexpr Q_ALWAYS_INLINE QStringView(const Container &c) noexcept
|
||||
Q_ALWAYS_INLINE constexpr QStringView(const Container &c) noexcept
|
||||
: QStringView(std::data(c), QtPrivate::lengthHelperContainer(c)) {}
|
||||
|
||||
template <typename Char, size_t Size, if_compatible_char<Char> = true>
|
||||
|
@ -21,10 +21,11 @@ void _mm_pause(void); // the compiler recognizes as intrinsic
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
Q_ALWAYS_INLINE
|
||||
#ifdef Q_CC_GNU
|
||||
__attribute__((artificial))
|
||||
#endif
|
||||
Q_ALWAYS_INLINE void qYieldCpu(void) Q_DECL_NOEXCEPT;
|
||||
void qYieldCpu(void) Q_DECL_NOEXCEPT;
|
||||
|
||||
void qYieldCpu(void)
|
||||
#ifdef __cplusplus
|
||||
|
@ -545,7 +545,7 @@ static QBitArray sizedForOverwrite(const QBitArray &a1, const QBitArray &a2)
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename BitwiseOp> static Q_NEVER_INLINE
|
||||
template <typename BitwiseOp> Q_NEVER_INLINE static
|
||||
QBitArray &performBitwiseOperationHelper(QBitArray &out, const QBitArray &a1,
|
||||
const QBitArray &a2, BitwiseOp op)
|
||||
{
|
||||
@ -581,7 +581,7 @@ QBitArray &performBitwiseOperationHelper(QBitArray &out, const QBitArray &a1,
|
||||
return out;
|
||||
}
|
||||
|
||||
template <typename BitwiseOp> static Q_NEVER_INLINE
|
||||
template <typename BitwiseOp> Q_NEVER_INLINE static
|
||||
QBitArray &performBitwiseOperationInCopy(QBitArray &self, const QBitArray &other, BitwiseOp op)
|
||||
{
|
||||
QBitArray tmp(std::move(self));
|
||||
@ -589,7 +589,7 @@ QBitArray &performBitwiseOperationInCopy(QBitArray &self, const QBitArray &other
|
||||
return performBitwiseOperationHelper(self, tmp, other, op);
|
||||
}
|
||||
|
||||
template <typename BitwiseOp> static Q_NEVER_INLINE
|
||||
template <typename BitwiseOp> Q_NEVER_INLINE static
|
||||
QBitArray &performBitwiseOperationInPlace(QBitArray &self, const QBitArray &other, BitwiseOp op)
|
||||
{
|
||||
if (self.size() < other.size())
|
||||
|
@ -106,7 +106,7 @@ struct HashSeedStorage
|
||||
}
|
||||
|
||||
private:
|
||||
Q_DECL_COLD_FUNCTION Q_NEVER_INLINE StateResult initialize(int which) noexcept;
|
||||
Q_NEVER_INLINE Q_DECL_COLD_FUNCTION StateResult initialize(int which) noexcept;
|
||||
};
|
||||
|
||||
[[maybe_unused]] HashSeedStorage::StateResult HashSeedStorage::initialize(int which) noexcept
|
||||
@ -413,7 +413,7 @@ namespace {
|
||||
}
|
||||
|
||||
// hash 16 bytes, running 3 scramble rounds of AES on itself (like label "final1")
|
||||
static void Q_ALWAYS_INLINE QT_FUNCTION_TARGET(AES) QT_VECTORCALL
|
||||
Q_ALWAYS_INLINE static void QT_FUNCTION_TARGET(AES) QT_VECTORCALL
|
||||
hash16bytes(__m128i &state0, __m128i data)
|
||||
{
|
||||
state0 = _mm_xor_si128(state0, data);
|
||||
|
@ -287,7 +287,7 @@ void qt_blend_rgb32_on_rgb32_avx2(uchar *destPixels, int dbpl,
|
||||
}
|
||||
}
|
||||
|
||||
static Q_NEVER_INLINE
|
||||
Q_NEVER_INLINE static
|
||||
void Q_DECL_VECTORCALL qt_memfillXX_avx2(uchar *dest, __m256i value256, qsizetype bytes)
|
||||
{
|
||||
__m128i value128 = _mm256_castsi256_si128(value256);
|
||||
|
@ -198,7 +198,7 @@ void QT_FASTCALL comp_func_Source_sse2(uint *dst, const uint *src, int length, u
|
||||
}
|
||||
|
||||
#ifndef __haswell__
|
||||
static Q_NEVER_INLINE
|
||||
Q_NEVER_INLINE static
|
||||
void Q_DECL_VECTORCALL qt_memfillXX_aligned(void *dest, __m128i value128, quintptr bytecount)
|
||||
{
|
||||
__m128i *dst128 = reinterpret_cast<__m128i *>(dest);
|
||||
|
@ -368,7 +368,7 @@ static const QRgba64 *QT_FASTCALL fetchRGBToRGB64(QRgba64 *buffer, const uchar *
|
||||
}
|
||||
|
||||
template<QImage::Format Format>
|
||||
static Q_ALWAYS_INLINE QRgbaFloat32 convertPixelToRGB32F(uint s)
|
||||
Q_ALWAYS_INLINE static QRgbaFloat32 convertPixelToRGB32F(uint s)
|
||||
{
|
||||
return QRgbaFloat32::fromArgb32(convertPixelToRGB32<Format>(s));
|
||||
}
|
||||
@ -481,7 +481,7 @@ static const QRgba64 *QT_FASTCALL fetchARGBPMToRGBA64PM(QRgba64 *buffer, const u
|
||||
}
|
||||
|
||||
template<QImage::Format Format>
|
||||
static Q_ALWAYS_INLINE QRgbaFloat32 convertPixelToRGBA32F(uint s)
|
||||
Q_ALWAYS_INLINE static QRgbaFloat32 convertPixelToRGBA32F(uint s)
|
||||
{
|
||||
return QRgbaFloat32::fromArgb32(convertPixelToARGB32PM<Format>(s));
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class QRgba64 {
|
||||
#endif
|
||||
};
|
||||
|
||||
explicit Q_ALWAYS_INLINE constexpr QRgba64(quint64 c) : rgba(c) { }
|
||||
Q_ALWAYS_INLINE explicit constexpr QRgba64(quint64 c) : rgba(c) { }
|
||||
public:
|
||||
QRgba64() = default;
|
||||
|
||||
@ -148,11 +148,11 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
static constexpr Q_ALWAYS_INLINE quint64 alphaMask() { return Q_UINT64_C(0xffff) << AlphaShift; }
|
||||
Q_ALWAYS_INLINE static constexpr quint64 alphaMask() { return Q_UINT64_C(0xffff) << AlphaShift; }
|
||||
|
||||
static constexpr Q_ALWAYS_INLINE quint8 div_257_floor(uint x) { return quint8((x - (x >> 8)) >> 8); }
|
||||
static constexpr Q_ALWAYS_INLINE quint8 div_257(quint16 x) { return div_257_floor(x + 128U); }
|
||||
constexpr Q_ALWAYS_INLINE QRgba64 unpremultiplied_32bit() const
|
||||
Q_ALWAYS_INLINE static constexpr quint8 div_257_floor(uint x) { return quint8((x - (x >> 8)) >> 8); }
|
||||
Q_ALWAYS_INLINE static constexpr quint8 div_257(quint16 x) { return div_257_floor(x + 128U); }
|
||||
Q_ALWAYS_INLINE constexpr QRgba64 unpremultiplied_32bit() const
|
||||
{
|
||||
if (isOpaque() || isTransparent())
|
||||
return *this;
|
||||
@ -162,7 +162,7 @@ private:
|
||||
const quint16 b = quint16((blue() * 0xffff + a/2) / a);
|
||||
return fromRgba64(r, g, b, quint16(a));
|
||||
}
|
||||
constexpr Q_ALWAYS_INLINE QRgba64 unpremultiplied_64bit() const
|
||||
Q_ALWAYS_INLINE constexpr QRgba64 unpremultiplied_64bit() const
|
||||
{
|
||||
if (isOpaque() || isTransparent())
|
||||
return *this;
|
||||
|
@ -89,11 +89,11 @@ public:
|
||||
constexpr quint16 blue16() const { return qRound(blueNormalized() * FastType(65535.0f)); }
|
||||
constexpr quint16 alpha16() const { return qRound(alphaNormalized() * FastType(65535.0f)); }
|
||||
|
||||
constexpr Q_ALWAYS_INLINE QRgbaFloat premultiplied() const
|
||||
Q_ALWAYS_INLINE constexpr QRgbaFloat premultiplied() const
|
||||
{
|
||||
return QRgbaFloat{r * a, g * a, b * a, a};
|
||||
}
|
||||
constexpr Q_ALWAYS_INLINE QRgbaFloat unpremultiplied() const
|
||||
Q_ALWAYS_INLINE constexpr QRgbaFloat unpremultiplied() const
|
||||
{
|
||||
if (a <= F{0.0f})
|
||||
return QRgbaFloat{}; // default-initialization: zeroes
|
||||
|
Loading…
x
Reference in New Issue
Block a user