| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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 <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
[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 <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
This replaces the logging category magic to determine whether we should
output warnings.
Change-Id: Ibc95ed70227e3438504e921693aa4af9a1d0376e
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to trigger the qFatal() when running qmlcachegen or qmlsc, but
we don't want to trigger it in qmllint, even if we are using the same
QtMsgType for the severity of the messages.
In turn, demote qmlCompiler messages to QtWarningMsg in qmlcachegen.
Pick-to: 6.4
Task-number: QTBUG-107168
Change-Id: Ib660df41742b2d426241eb29ac4c91f4933c5ba1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:
auto QtContainerClass = anyOf(
expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.
Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We need those to prevent usage of the host Qt's import path when
building QML files for the target.
Task-number: QTBUG-106365
Pick-to: 6.4 6.4.0
Change-Id: I34499af850fb759603206cb429ff97633c76054d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
| |
Use QHashSeed::setDeterministicGlobalSeed() instead
Task-number: QTBUG-105102
Change-Id: I1d13f3872b335ff9998f7c4538d3b9c3c77fe232
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change makes qmljslogger use an ID based system for categorizing
logging entries instead of using an enum. This allows plugins to
register their own logging categories after the fact.
It's also necessary for us to later show the warning ID when
printing warnings and for creating documentation for each ID entry.
Currently not every ID maps cleanly to only one type of warning,
this has to be cleaned up in a follow-up change.
Task-number: QTBUG-103453
Change-Id: I4cac6be7ca165b938e0ea032d077823bf17baf75
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
| |
Converts qmlcompiler into a shared library so it isn't duplicated when
statically linked in tools and so that plugins can link against it.
Change-Id: I91e13cc588796f71a5463dbdce21e42a74120565
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
| |
We've accidentally disabled the pragma Strict check when re-designing
the logging system.
Change-Id: I74cf0d4a45742831037ec0bc0615f1f6a15b7023
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
High-level goal: be able to reuse existing infrastructure
"as is" to configure semantic analysis categories in tools
(qmllint, qmltc, qmlsc, etc.)
To achieve that, simplify the logging to always "log"
something, without explicitly specifying the severity. The
severity is now baked into the category (and we can extend
those to cover different cases)
One slight deviation is the cache generation which likes
to do its own thing at present. Provide a "forced logging"
option where we can specify which severify we want. The
hope is that this gets removed at some point
Particular list of (noteworthy) changes:
* No more "thresholding" by the level (this is rarely needed
and is actually questionable). Instead, we can ignore a
particular category explicitly
* Category levels are repurposed as category severities
(at least from the high-level picture that always should've
been this way)
* log{Warning,Info,Critical} removed. We use category severity
instead
* "category error" makes zero sense so removed: if our severity
is:
- QtWarningMsg (qmllint), it is already an "error"
- QtCriticalMsg (compilers), it is already an "error"
* Align m_output and m_{infos,warnings,errors} stored information
* Accept the fact that we don't support QtDebugMsg and QtFatalMsg
* Additional categories added to cover for places where the same
category would be both an error and not an error
Task-number: QTBUG-100052
Change-Id: I3cd5d17d58be204f48428877bed053f756ac40a8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds a warning if we encounter a component marked as a
singleton in a qmldir file which does not contain a pragma
Singleton entry and vice versa.
Note that the warning only gets triggered if the singleton is
actually used.
Fixes: QTBUG-98558
Change-Id: Id7c63f48ba49759c15dffcaee0270c7caab2eb7d
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tools will still grudgingly accept qmltypes files being passed via
the -i option. We generally expect qmldir files, though. Ignoring the
qmldir file and importing the qmltypes directly, ignores qmldir imports,
dependencies and other component entries. This leads to unresolvable
types.
[ChangeLog][QML Tooling] qmllint expects qmldir files, not qmltypes
files to be passed via the -i option now. This enables it to see the
imports and dependencies of the module being imported. For backwards
compatibility it still accepts qmltypes files, with a warning.
Pick-to: 6.3
Fixes: QTBUG-99043
Change-Id: I5ed32d7e78df1e604aaf1bfa2ebda09d5d57b628
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
qmlcachegen compiles bindings and functions to C++ as far as
QQmlJSAotCompiler can. It does respect "pragma Strict" and rejects the
file if it's violated. Furthermore, it sets up the logger to follow the
qt.qml.compiler.aot logging category. By default it's completely silent.
Compiling the examples with qmlcachegen exposes a bug in the type
resolver where it returns an invalid generic type. It should never do
that. Fix it by returning JSValue.
[ChangeLog][QtQml][Important Behavior Changes] QML bindings and
functions are now compiled to C++ by qmlcachegen, if possible. Use the
qt.qml.compiler.aot logging category to receive diagnostics about the
compilation.
Task-number: QTBUG-98305
Change-Id: I6953812c3fd20b68339617a5714fcbe16a384360
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't need --qmljs-runtime after all. However, we do want to pass
custom arguments to qmlcachegen. This way we don't need to change the
world whenever we invent one.
Pick-to: 6.2
Change-Id: I99f0c99c4b15e469605dc43d26871fa43dc36c08
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
| |
'resource-file-mapping option' is actually using '=' in code and tools
Change-Id: I0d67e13e9d614bf973a0d4332c6b4dcda4c121a4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
In other implementations this may be used the same way as qmllint's -I
option, to specify additional import paths.
Change-Id: I447712551ff1fb2a7c379712e938f778b37c514a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We need more generic filtering capabilities so that it can, for example,
retrieve all the .qml files in a directory, both as qrc paths and local
file paths.
Change-Id: I72a72abc6dd39adb41bcd035f7aa6777e50cb5a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
--resource-path directly specifies the resource path for the file being
compiled and overrides any information we might retrieve from the qrc
file. However, we might still find other relevant information in the qrc
file.
Change-Id: I587c6e4e81f792f62a28b035ee97b33d12eeb06d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
qmlcachegen needs to see the qmltypes file for the current project so
that it can query it for C++ types exposed to QML.
This is only relevant when generating C++ code, which qmlcachegen itself
cannot do. However, in order to write a compatible drop-in, we need it.
Also, hide related ignored options from --help in qmlcachegen.
Change-Id: Id2f1b8b1750351c7de8dfe49e4065ef1b29423b7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This signals qmlcachegenplus to not paste the whole JavaScript type
system into each generated file. In turn, user projects need to add a
dependency in order to build against the JS runtime.
qmlcachegen ignores the option.
Change-Id: I0f87dedb969e99e94fbb712b7faa23d84f76dfbe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
qmlcachegenplus has an argument --direct-calls which instructs it to
call methods of known C++ types directly rather than through the JS
engine or the metaobject. This is faster but requires that all those
types are visible to the generated code. Introduce a way to pass this
option on a per-target base.
Adjust qmlcachegen to ignore the option.
Change-Id: I474e577e4a197f6ca4c8b8e868dfd39983e77041
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We need to re-use them. Also, provide a way to insert AOT compiled
functions into the C++ code.
Change-Id: I7b0d13cb307e8f979745f096a9614f087d135f68
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This enables us to use the same generateloader.cpp for qmlcachegen and
any replacement that actually produces AOT compiled functions.
Change-Id: I12fe81236e4ef16a627729c644d54b6c171b3860
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
We need to be able to generate the loader code from multiple places.
Change-Id: I9e04fd3583b535bc5f7d5fb293cb61309c1e199a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
For backwards compatibility, a replacement for qmlcachegen will need to
provide the same functionality.
Change-Id: I22664230ea636d384190122223d15819ebee930c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
The file class names should start with a common prefix.
Change-Id: I5e014c103668a1bc73d359b00a1dda33e5637a79
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Move all the code from tools/shared into src/qmlcompiler and build a
static library from it so that we can re-use it in external tools.
Change-Id: I7c8d8e59063dc7c711f4072f103a01095e6f5997
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
dependencies.yaml
src/qml/qml/qqmlengine.cpp
Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is needed in a few places outside of declarative, so this change
restores the loc member in DiagnosticMessage and moves
QQmlJS::AST::SourceLocation into common's QQmlJS namespace/directory.
QQmlError is unaffected and retains only line/column.
Amends d4d197d06279f9257647628f7e1ccc9ec763a6bb
Change-Id: Ifb9d344228e3c6e9e26fc4fe112686f9336ea2b2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Use Qt::hex() instead.
Change-Id: I46bc2f2006ce860cd938a86432783011365c8164
Reviewed-by: Liang Qi <liang.qi@qt.io>
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Removed dependencies.yaml because we don't use it yet in wip/cmake.
Fixed conflict in qmlcachegen.cpp.
Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
|
| |\|
| | |
| | |
| | | |
Change-Id: I801567c11fcc3244a1ee7dabeb5079d49fc5c3a1
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Commit 41864db3b61d9e81a9fe4906918d2cd3d6d32a0c removed the processing
of .qrc files that removed .qml/etc. files. Since the chaining of
resources remains critical to ensure that the cached compilation units
are loaded, the build system copied the input .qrc file to a new one.
That mere copying caused the build to break when the copied .qrc file
was not in the same directory as the original one, as file paths within
the .qrc file are interpreted as relative to the .qrc file, which was
now in a different location. To fix this, this patch brings back the
"filtering" code that rewrites the paths to the source files in the .qrc
file.
Fixes: QTBUG-78253
Change-Id: Ie1d56f3248e713a964260bc2da37c9374f7b6a36
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |\ \
| | |/
| |/|
| | | |
Change-Id: I10c4b7fcfa0397d999d45e310c2f8f051d57d4d2
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
[ChangeLog][QtQml][Important Behavior Changes] Using the Qt Quick
Compiler would exclude the original .qml files from the resource system.
This made it impossible to change the Qt library binary later as the
program binary was tied the to the exact Qt version. In addition
sometimes unrelated files (QTBUG-73669) were removed. For the latter
scenario, retain and skip options were added for the Qt Quick Compiler.
In Qt 5.15 the Qt Quick Compiler does not remove the input files
anymore. All files are retained and the compiler merely adds the more
efficient binary representation to the application.
Task-number: QTBUG-73669
Change-Id: I5a523bfc69d4f48a1451bd880616c82fd73b8d15
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|\ \ \
| | |/
| |/|
| | | |
Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
.qmake.conf
src/qml/qml/qqmlengine.cpp
src/qmlmodels/qqmlmodelsmodule.cpp
Change-Id: Id60420f8250a9c97fcfe56d4eea19b62c6870404
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: If990efb64a4117bc7624062fededa7ce6a910f14
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add missing code so we can use the --retain argument when running
qmlcachgen from a CMake project.
Change-Id: I0b4a2f2ea6c424ba698ee178a332f585271b945e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added support for response file expansion to qmlcachegen.
Add the option --standalone-namespace to qmlcachegen so we can
generate qmlcache_loader from a collection of resource paths
instead of operating on qrc files. This is necessary, since the
namespace identifier is extraced from the qrc file name, which
we no longer have.
This pach was made in order to tend to the cmake port's version of
qtquickcompiler support which does not rely on qrc files.
Change-Id: If15190f3492e6695f5a6e61bf8816998760541f7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I4476733af61fcf3a2af1d121a4585c3fae1c240e
|
| |
| |
| |
| |
| |
| |
| |
| | |
Avoid using namespace in headers and include only the headers we
actually need.
Change-Id: I526a0f874dc09b07693fd87070665be396d3b637
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I2219cba0dd3782cb2e0b09b8f3c4d5472e6e5d7e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Ifc24fbd99ee216e528a213fdbfd2892b3df419fe
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There can only ever be one error, either a syntax error or a reference
error. We record the error type as we want to get rid of the virtual
throw<X>Error methods in favor of an explicit compilation result.
Change-Id: Ie228490aad8efb7885083f6485f931299567f54c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
| |
Fixes the QTextStream usages.
Change-Id: I0c009a82fb644a9f3c3d42ec410d18b680977f23
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|