<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qt/qtdeclarative.git/tools/qmlcachegen/qmlcachegen.cpp, branch 6.8.1</title>
<subtitle>Qt Declarative (Quick 2)
</subtitle>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/'/>
<entry>
<title>aotstats: Keep track of files and modules with no functions or bindings</title>
<updated>2024-11-06T10:42:02+00:00</updated>
<author>
<name>Olivier De Cannière</name>
<email>olivier.decanniere@qt.io</email>
</author>
<published>2024-10-23T08:14:23+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=cb52469a03160531730e6b1a05892838f36ae899'/>
<id>cb52469a03160531730e6b1a05892838f36ae899</id>
<content type='text'>
Before this change, the report presented to the user would be
completely silent about them. For the sake of consitency, register each
file before trying to compile it. This will then add an entry for empty
files and modules.

Task-number: QTBUG-124667
Change-Id: I502660b7a16a67a173763f9ea2b081cbcceb5658
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
(cherry picked from commit 4dab304aeb42d1237f3eba863eeb66ba2a18b2b0)
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this change, the report presented to the user would be
completely silent about them. For the sake of consitency, register each
file before trying to compile it. This will then add an entry for empty
files and modules.

Task-number: QTBUG-124667
Change-Id: I502660b7a16a67a173763f9ea2b081cbcceb5658
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
(cherry picked from commit 4dab304aeb42d1237f3eba863eeb66ba2a18b2b0)
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>aotstats: Support --only-bytecode and modules with no qml files</title>
<updated>2024-11-06T10:42:00+00:00</updated>
<author>
<name>Olivier De Cannière</name>
<email>olivier.decanniere@qt.io</email>
</author>
<published>2024-10-30T12:40:55+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=012f827c2d9776c92b7ffd169f2f77e2a02dbd88'/>
<id>012f827c2d9776c92b7ffd169f2f77e2a02dbd88</id>
<content type='text'>
It is possible to pass --only-bytecode to qmlcachegen. As the name
implies, this only generates the bytecode for the qml files and does not
compile them. This case was not taken into account which could lead to
files commands depend upon not being generated.

Therefore, keep track of empty and only-bytecode modules in files
generated by cmake and pass them to qmlaotstats upon aggregation such
that it can include that information in the report.

Also, only pass the arguments specific to aotstats to qmlcachegen if
--only-bytecode is not set for that module.

Fixes: QTBUG-130084
Task-number: QTBUG-124667
Change-Id: I44b4a80e8a6fd2f9bc16ae1bb2c8d540ff3b697b
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
(cherry picked from commit 318ac440653a570d2bd18fc3d25e1b2fc8af88fa)
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is possible to pass --only-bytecode to qmlcachegen. As the name
implies, this only generates the bytecode for the qml files and does not
compile them. This case was not taken into account which could lead to
files commands depend upon not being generated.

Therefore, keep track of empty and only-bytecode modules in files
generated by cmake and pass them to qmlaotstats upon aggregation such
that it can include that information in the report.

Also, only pass the arguments specific to aotstats to qmlcachegen if
--only-bytecode is not set for that module.

Fixes: QTBUG-130084
Task-number: QTBUG-124667
Change-Id: I44b4a80e8a6fd2f9bc16ae1bb2c8d540ff3b697b
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
(cherry picked from commit 318ac440653a570d2bd18fc3d25e1b2fc8af88fa)
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Compiler: Make qqmljsscope::filePath hold the source location more often</title>
<updated>2024-11-01T15:37:36+00:00</updated>
<author>
<name>Olivier De Cannière</name>
<email>olivier.decanniere@qt.io</email>
</author>
<published>2024-10-14T10:37:54+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=df93ce0b9812220861630444754b410811e7d50c'/>
<id>df93ce0b9812220861630444754b410811e7d50c</id>
<content type='text'>
Previously, it would hold the location of the copy in the build
directory or in the resource file system.

This should improve the accuracy of the information that we can report
back. For example, the file location of files reported in aotstats will
now be those in the source folder.

The changes necessary for this patch were found through trial and error
by asserting that the filePath respect a certain form and fixing what I
could. There remain cases where the filePath still contains a location
in the build directory. We would need some other change to report those
accurately as well.

Finally, sometimes the filePath is empty or does not contain a valid
path at all but instead what seems to be the location of an included
file. It can have the form "private/..._p.h" for example.

Change-Id: I77a2596f6c4a179580d924a6e9324e43dbb86c0c
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
(cherry picked from commit ee5c015b3a38767ad25baa6355023932fe7aca77)
Reviewed-by: Qt Cherry-pick Bot &lt;cherrypick_bot@qt-project.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, it would hold the location of the copy in the build
directory or in the resource file system.

This should improve the accuracy of the information that we can report
back. For example, the file location of files reported in aotstats will
now be those in the source folder.

The changes necessary for this patch were found through trial and error
by asserting that the filePath respect a certain form and fixing what I
could. There remain cases where the filePath still contains a location
in the build directory. We would need some other change to report those
accurately as well.

Finally, sometimes the filePath is empty or does not contain a valid
path at all but instead what seems to be the location of an included
file. It can have the form "private/..._p.h" for example.

Change-Id: I77a2596f6c4a179580d924a6e9324e43dbb86c0c
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
(cherry picked from commit ee5c015b3a38767ad25baa6355023932fe7aca77)
Reviewed-by: Qt Cherry-pick Bot &lt;cherrypick_bot@qt-project.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Compiler: Record statistics about aot compilation</title>
<updated>2024-05-28T08:25:41+00:00</updated>
<author>
<name>Olivier De Cannière</name>
<email>olivier.decanniere@qt.io</email>
</author>
<published>2024-05-24T11:21:44+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=8827af0fe87270739c611ece091eb51c234dde3c'/>
<id>8827af0fe87270739c611ece091eb51c234dde3c</id>
<content type='text'>
This patch introduces the collection of statistics about the
ahead-of-time compilation of functions and bindings to Cpp by
qmlcachegen. This is done by having qmlcachegen save an aotstats file
for every qml file it compiles. This file contains, for every function
and binding, whether the Cpp codegen was successful, its duration and a
potential error message

Task-number: QTBUG-124667
Change-Id: Iba9a72be04f6642688533a3ae12ea687296c85e1
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch introduces the collection of statistics about the
ahead-of-time compilation of functions and bindings to Cpp by
qmlcachegen. This is done by having qmlcachegen save an aotstats file
for every qml file it compiles. This file contains, for every function
and binding, whether the Cpp codegen was successful, its duration and a
potential error message

Task-number: QTBUG-124667
Change-Id: Iba9a72be04f6642688533a3ae12ea687296c85e1
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qmlcompiler: Sanitize qmldir paths before using them</title>
<updated>2024-05-17T15:34:33+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2024-05-16T13:53:23+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=9b784345795984878d2938d6903e7c87ae7f0778'/>
<id>9b784345795984878d2938d6903e7c87ae7f0778</id>
<content type='text'>
They may contain backslashes.

Pick-to: 6.7 6.5
Fixes: QTBUG-125393
Change-Id: Ifd8c97c44b036ab64a221775a7fe6316445f6cf8
Reviewed-by: Friedemann Kleint &lt;Friedemann.Kleint@qt.io&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
They may contain backslashes.

Pick-to: 6.7 6.5
Fixes: QTBUG-125393
Change-Id: Ifd8c97c44b036ab64a221775a7fe6316445f6cf8
Reviewed-by: Friedemann Kleint &lt;Friedemann.Kleint@qt.io&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qmlcachegen: Add hidden --static option</title>
<updated>2024-04-18T12:42:40+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2024-04-18T09:05:44+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=1e0db4577a8a2a4fca008d9dd58becb5ebf09757'/>
<id>1e0db4577a8a2a4fca008d9dd58becb5ebf09757</id>
<content type='text'>
We want qmlcachegen to accept the same arguments as qmlsc so that people
don't have to fiddle with the build system when they need to switch
between them.

Pick-to: 6.7 6.5
Change-Id: If21cbd262104c68c96649b4b0882c079c3862f05
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want qmlcachegen to accept the same arguments as qmlsc so that people
don't have to fiddle with the build system when they need to switch
between them.

Pick-to: 6.7 6.5
Change-Id: If21cbd262104c68c96649b4b0882c079c3862f05
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add --warnings-are-errors option to qmlcachegen</title>
<updated>2023-12-22T08:50:34+00:00</updated>
<author>
<name>Joerg Bornemann</name>
<email>joerg.bornemann@qt.io</email>
</author>
<published>2023-12-20T12:50:19+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=107c5da80c56cf2540c415810fc7b2b9a2540cd2'/>
<id>107c5da80c56cf2540c415810fc7b2b9a2540cd2</id>
<content type='text'>
[ChangeLog][qmlcachegen] Added the --warnings-are-errors option that
treats warnings as errors when generating C++ code.

Like gcc's -Werror, this option is useful when aiming at warning-free
QML code. Add it to the QT_QMLCACHEGEN_ARGUMENTS target property to
error out once warnings have been encountered.

Change-Id: If72875b33052b37642b18fa192a1344c347990d8
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ChangeLog][qmlcachegen] Added the --warnings-are-errors option that
treats warnings as errors when generating C++ code.

Like gcc's -Werror, this option is useful when aiming at warning-free
QML code. Add it to the QT_QMLCACHEGEN_ARGUMENTS target property to
error out once warnings have been encountered.

Change-Id: If72875b33052b37642b18fa192a1344c347990d8
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Compiler: Separate function prolog block and add validation of blocks</title>
<updated>2023-08-04T07:34:09+00:00</updated>
<author>
<name>Olivier De Cannière</name>
<email>olivier.decanniere@qt.io</email>
</author>
<published>2023-07-11T13:01:10+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=2cf9aeccddbd06a66df94bd27916714c4a5c7e24'/>
<id>2cf9aeccddbd06a66df94bd27916714c4a5c7e24</id>
<content type='text'>
The function prolog logic is now separated in its own basic block. The
first "real" block with user code starts at offset 0.

Having the function prolog as a hidden part of the first block caused
some inconsistencies in block generation and would create empty blocks.
This happened for example when a back edge of a loop would target offset
0 in code where a loop condition is the very first set of instructions
that are run. This is because the target block offset didn't exist due
to it being part of the hidden prolog block.

Validation for the basic blocks was also added. This checks for three
things at the moment:
1. That return and throw blocks don't have jump targets.
2. That the basic blocks graph is connected.
3. That jump targets are the first offset of a block.

Test tst_QmlCppCodegen::basicBlocksWithBackJump_infinite() is expected
to fail because it contains an infinite loop and the basic blocks that
are generated for it are inconsistent due to dead-code elimination
happening earlier in compilation.

Debug outputs for dumping basic blocks were also adapted to reflect
these changes.

Change-Id: I513f73856412d488d443c2b47a052b0023d45496
Reviewed-by: Qt CI Bot &lt;qt_ci_bot@qt-project.org&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function prolog logic is now separated in its own basic block. The
first "real" block with user code starts at offset 0.

Having the function prolog as a hidden part of the first block caused
some inconsistencies in block generation and would create empty blocks.
This happened for example when a back edge of a loop would target offset
0 in code where a loop condition is the very first set of instructions
that are run. This is because the target block offset didn't exist due
to it being part of the hidden prolog block.

Validation for the basic blocks was also added. This checks for three
things at the moment:
1. That return and throw blocks don't have jump targets.
2. That the basic blocks graph is connected.
3. That jump targets are the first offset of a block.

Test tst_QmlCppCodegen::basicBlocksWithBackJump_infinite() is expected
to fail because it contains an infinite loop and the basic blocks that
are generated for it are inconsistent due to dead-code elimination
happening earlier in compilation.

Debug outputs for dumping basic blocks were also adapted to reflect
these changes.

Change-Id: I513f73856412d488d443c2b47a052b0023d45496
Reviewed-by: Qt CI Bot &lt;qt_ci_bot@qt-project.org&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qmlcachegen: Add a --verbose command line option</title>
<updated>2023-04-24T20:22:13+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2023-04-20T14:48:17+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=a7c92814f0ff6e9253c781b90e70ad645f8cd94e'/>
<id>a7c92814f0ff6e9253c781b90e70ad645f8cd94e</id>
<content type='text'>
This replaces the logging category magic to determine whether we should
output warnings.

Change-Id: Ibc95ed70227e3438504e921693aa4af9a1d0376e
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This replaces the logging category magic to determine whether we should
output warnings.

Change-Id: Ibc95ed70227e3438504e921693aa4af9a1d0376e
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QML: Turn singleton/type mismatch into a run time type error</title>
<updated>2023-01-27T09:42:06+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2023-01-23T09:03:00+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=ddba87612d2be25863135669e81bc3391dc40e82'/>
<id>ddba87612d2be25863135669e81bc3391dc40e82</id>
<content type='text'>
There are many ways to "hide" the qmldir from the engine at run time,
which turns singletons into regular types. While all of this is invalid,
we should not assert on it, but rather produce a legible warning.

Furthermore, sharpen the importing of extra modules from qrc as implicit
imports. We should really only import modules the file in question can
ever be part of. Otherwise we needlessly produce the above situation and
hide legitimate warning messages.

Amends commit 7517c1b3ae9aa92f36b19d74a4b2de5e8531309b.

Now we need to teach our tools about the default import paths in the
resorurce file system. They cannot guess any type they may find in any
resource file anymore.

Pick-to: 6.5
Task-number: QTBUG-106929
Change-Id: Ic8c02396d10830a7f461e8a81649bb8c9a1add1f
Reviewed-by: Qt CI Bot &lt;qt_ci_bot@qt-project.org&gt;
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are many ways to "hide" the qmldir from the engine at run time,
which turns singletons into regular types. While all of this is invalid,
we should not assert on it, but rather produce a legible warning.

Furthermore, sharpen the importing of extra modules from qrc as implicit
imports. We should really only import modules the file in question can
ever be part of. Otherwise we needlessly produce the above situation and
hide legitimate warning messages.

Amends commit 7517c1b3ae9aa92f36b19d74a4b2de5e8531309b.

Now we need to teach our tools about the default import paths in the
resorurce file system. They cannot guess any type they may find in any
resource file anymore.

Pick-to: 6.5
Task-number: QTBUG-106929
Change-Id: Ic8c02396d10830a7f461e8a81649bb8c9a1add1f
Reviewed-by: Qt CI Bot &lt;qt_ci_bot@qt-project.org&gt;
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
</pre>
</div>
</content>
</entry>
</feed>
