diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-04-05 12:11:25 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-04-06 11:19:16 +0000 |
commit | 9b961334cfd81ec5fcc4dc7d2c50154cddd5f230 (patch) | |
tree | 427538213284200910d9ee53220c5cac246dd891 /tools/qmlcachegen | |
parent | 028a85f4f462093ca93ae95865eb6cbcbaec199a (diff) |
Fix support for jsTr() and QT_TR_NOOP in list elements when caching
Similar to the Qt Quick Compiler we need to do the expression
simplification pass at cache generation time to extract translation
calls in list elements.
Change-Id: I267fc9647ab82bc83d6b087c06c0036df38238ff
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools/qmlcachegen')
-rw-r--r-- | tools/qmlcachegen/qmlcachegen.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp index 3c25f5347b..b201176d5e 100644 --- a/tools/qmlcachegen/qmlcachegen.cpp +++ b/tools/qmlcachegen/qmlcachegen.cpp @@ -37,6 +37,7 @@ #include <private/qqmlirbuilder_p.h> #include <private/qv4isel_moth_p.h> #include <private/qqmljsparser_p.h> +#include <private/qv4jssimplifier_p.h> QT_BEGIN_NAMESPACE @@ -174,7 +175,10 @@ static bool compileQmlFile(const QString &inputFileName, const QString &outputFi QmlIR::QmlUnitGenerator generator; - // ### translation binding simplification + { + QQmlJavaScriptBindingExpressionSimplificationPass pass(irDocument.objects, &irDocument.jsModule, &irDocument.jsGenerator); + pass.reduceTranslationBindings(); + } QV4::ExecutableAllocator allocator; QScopedPointer<QV4::EvalInstructionSelection> isel(iselFactory->create(/*engine*/nullptr, &allocator, &irDocument.jsModule, &irDocument.jsGenerator)); @@ -264,8 +268,6 @@ static bool compileJSFile(const QString &inputFileName, const QString &outputFil QmlIR::QmlUnitGenerator generator; - // ### translation binding simplification - QV4::ExecutableAllocator allocator; QScopedPointer<QV4::EvalInstructionSelection> isel(iselFactory->create(/*engine*/nullptr, &allocator, &irDocument.jsModule, &irDocument.jsGenerator)); // Disable lookups in non-standalone (aka QML) mode |