summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcommandlineoption.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-06-27 11:19:20 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-07-16 13:24:23 +0000
commita3f780b4a1e80b706b5225edcc6ca6fb8938d065 (patch)
treeb5e9db7b35a61dca37e8f265e1d0681451fe8ff8 /src/corelib/tools/qcommandlineoption.cpp
parentc3597c3fcfbc472c8dce1a8d1dd27f442760deaa (diff)
QCommandLineOption: prevent aggressive inlining
Even though we expect very few option names, GCC unrolls the loop calling IsInvalidName::operator() four times. Together with the lead-in/lead-out for size() % 4 != 0, that makes for five inlined copies of the function call operator. I don't know how to prevent the unrolling, but at least I can stop the inlining. Change-Id: Ib9d6c33e8193464a73927a92b8b54c3452cb26a3 Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/tools/qcommandlineoption.cpp')
-rw-r--r--src/corelib/tools/qcommandlineoption.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp
index 724803bce9..eb50cee5bb 100644
--- a/src/corelib/tools/qcommandlineoption.cpp
+++ b/src/corelib/tools/qcommandlineoption.cpp
@@ -250,6 +250,7 @@ namespace {
typedef bool result_type;
typedef QString argument_type;
+ Q_NEVER_INLINE
result_type operator()(const QString &name) const Q_DECL_NOEXCEPT
{
if (Q_UNLIKELY(name.isEmpty()))