From 9a08483d763dacfca6029f7a8970846e83df0e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Wed, 5 Mar 2014 17:32:24 +0100 Subject: [PATCH] Try to speedup tst_qmetatype.cpp compilation with clang. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test instantiates enormous amounts of templates in one compilation unit. All clang versions, that I tested, suffers from performance issues while compiling the test, the cost depends on the version. The most affected are shipped by Apple. Task-number: QTBUG-37237 Change-Id: I0959c1a4a6faee448ae1dae5c1e70ee06cefbd9c Reviewed-by: Simo Fält Reviewed-by: Frederik Gladhorn --- tests/auto/corelib/kernel/kernel.pro | 4 ---- tests/auto/corelib/kernel/qmetatype/qmetatype.pro | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro index 3ec783ab2c..604a0f4fd8 100644 --- a/tests/auto/corelib/kernel/kernel.pro +++ b/tests/auto/corelib/kernel/kernel.pro @@ -21,10 +21,6 @@ SUBDIRS=\ qvariant \ qwineventnotifier -# Building the qmetatype test with Clang on ARM takes forever (QTBUG-37237) -!clang|!contains(QT_ARCH, arm): \ - SUBDIRS += qmetatype - !qtHaveModule(gui): SUBDIRS -= \ qmimedata diff --git a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro index d19ec23760..fc262b8fc7 100644 --- a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro +++ b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro @@ -15,3 +15,18 @@ win32-msvc*|wince|winrt { QMAKE_CFLAGS_RELEASE -= -O2 } } + +clang { + # clang has some performance problems with the test. Especially + # with automaticTemplateRegistration which creates few thousands + # template instantiations (QTBUG-37237). Removing -O2 and -g + # improves the situation, but it is not solving the problem. + QMAKE_CXXFLAGS_RELEASE -= -O2 + QMAKE_CFLAGS_RELEASE -= -O2 + QMAKE_CXXFLAGS_RELEASE -= -g + QMAKE_CFLAGS_RELEASE -= -g + + # Building for ARM (eg iOS) is affected so much that we disable + #the template part of the test + contains(QT_ARCH, arm): DEFINES += TST_QMETATYPE_BROKEN_COMPILER +}