summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-05-12 07:54:34 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-05-13 17:13:46 +0200
commit949b85a721e9970dda2a3e3566bb7530b423beee (patch)
treec9a4fbd1a3c14363e2f6123053aec6cd4d48b527 /src
parentc5183b497e6652787e84b57f0443cf8b4f6e48c4 (diff)
QObject: mark two error reporting functions COLD
They already nicely factored this error-only code from the normal path of execution. All that was missing was for them to be marked as COLD, so the compiler moves them out of the way even further, and optimizes them for size, not speed. TEXT size savings: ~400b on GCC 11.2 and ~500b on Clang 10 optimized C++20 AMD64 Linux builds. Pick-to: 6.3 6.2 5.15 Change-Id: I64a4123645855b4e34fbb0bc3304d144d7191a0d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qobject.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 475e8eb447f..c9bc48fecda 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2691,6 +2691,7 @@ static bool check_method_code(int code, const QObject *object, const char *metho
return true;
}
+Q_DECL_COLD_FUNCTION
static void err_method_notfound(const QObject *object,
const char *method, const char *func)
{
@@ -2708,6 +2709,7 @@ static void err_method_notfound(const QObject *object,
object->metaObject()->className(), method + 1, loc ? " in " : "", loc ? loc : "");
}
+Q_DECL_COLD_FUNCTION
static void err_info_about_objects(const char *func, const QObject *sender, const QObject *receiver)
{
QString a = sender ? sender->objectName() : QString();