From a3f780b4a1e80b706b5225edcc6ca6fb8938d065 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 27 Jun 2015 11:19:20 +0200 Subject: 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 --- src/corelib/tools/qcommandlineoption.cpp | 1 + 1 file changed, 1 insertion(+) 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())) -- cgit v1.2.3