summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-05-23 09:53:49 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-06-20 04:39:05 +0000
commit669487fe9549a896ea4ec3c63fa7ad8585e74b63 (patch)
treec5c799defb7c054e6ca806ef22652a0c0814fa12
parent90da7ba49c91f72ca16944822b8860d2c59bcea1 (diff)
QCommandLineOption: prevent aggressive inlining
There is a good chance that in every program, command line options that have only one name and those that have multiple names are used. Make better use of the icache by not inlining the Private ctors into the QCommandLineOption ones. Saves 400B in text size on Linux GCC 4.9 C++11 release builds. Change-Id: I6247d4a2330c5fff75d06f5a40223d972b267e85 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/tools/qcommandlineoption.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp
index 58e3e3e79f..58fec597bc 100644
--- a/src/corelib/tools/qcommandlineoption.cpp
+++ b/src/corelib/tools/qcommandlineoption.cpp
@@ -41,11 +41,13 @@ QT_BEGIN_NAMESPACE
class QCommandLineOptionPrivate : public QSharedData
{
public:
+ Q_NEVER_INLINE
explicit QCommandLineOptionPrivate(const QString &name)
: names(removeInvalidNames(QStringList(name))),
hidden(false)
{ }
+ Q_NEVER_INLINE
explicit QCommandLineOptionPrivate(const QStringList &names)
: names(removeInvalidNames(names)),
hidden(false)