| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
| |
Amends db0913a323c28c93c362a9b128f62d00bb83355f
Pick-to: 6.9 6.8 6.5
Change-Id: I7230644465832c9de1b8343b01948a606a15012d
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
| |
Amends 959836a5b3e2cc106ed8c05649c81ed873aa12e2
Change-Id: I64a04f20beed34cb853e69a356734bcb6f7f0349
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
|
| |
QVector is just an alias for QList in Qt 6, so use
the latter directly.
Change-Id: I55792668400b4ad46929dc2b9b9bc1b68cbc4b00
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the type propagator, when encountering back jumps, we need to run the
pass again in order to ensure that the state of the registers at the
target of the jump is fully known.
For this, we need to compare the latest state in the current pass with
states we have encountered earlier. If a match is found, no more passes
are needed.
The propagation is run multiple times and state is accumulated between
passes. For certain conversions, this will try to append types as
origins again every iteration. These would previously have been
deduplicated by QQmlJSTypeResolver::merge but, since the change at
1e095058e165b1c2f244799ca1928ae4cc046a2c, we consider 2 registers to be
equal only if their d pointers are equal. And since instructions such as
MoveRegexp create a new register for the literal type RegExpr every
time, the pointer doesn't match with the one from the register created
by the instruction during the ealier pass. This would lead to set of
origin types growing forever and to the state never matching a previous
one. This, in turn, caused an infinite loop because an additional pass
was always deemed necessary.
Therefore, restore the old logic that deduplicates based on contained
type, variant, and (recursively) scope.
Amends 1e095058e165b1c2f244799ca1928ae4cc046a2c
Fixes: QTBUG-135457
Pick-to: 6.9
Change-Id: I23167e95b958304698d12537598c1d72b03a5364
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
|
| |
This commit fixes several broken links in \nativetype.
Pick-to: 6.9 6.8
Change-Id: I45c599eb165b062b2a9eddea3fd13b90d2d7fd74
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
| |
The binding might not update if their value changes.
Fixes: QTBUG-112508
Change-Id: I27801d662117a89c0fdddc2aaa2f1dde21b238df
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Warn about duplicate property bindings for object and script bindings.
Remove a TODO about doing this task that seemed to be at the wrong
place.
Fixes: QTBUG-118102
Change-Id: I46696b696f6c7e0c83e36077998d6118b14498ad
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
| |
Change-Id: Ia71e88dbd983303c15e532b812550214426d4d6d
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because we only search for the name of the property in the
scopesToSearch and not which property that name actually references, we
confuse a property of the same name in a neighboring scope for the
actual required one.
Include the property's owning scope when searching through the scopes.
Amends daf57e29de918b7b4be7bb0d469db0c51d41bb07
Fixes: QTBUG-136058
Pick-to: 6.9 6.8
Change-Id: I998901fd0840270dd2048e7257d6eaca556b513d
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Amends daf57e29de918b7b4be7bb0d469db0c51d41bb07
Task-number: QTBUG-136058
Pick-to: 6.9 6.8
Change-Id: Ibf412089427e4d9d5a568ee24c224b9fa41fd20a
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Move it next to QQmlJSImportVisitor::checkRequiredProperties and also
make it filter out any scope that isn't of type QMLScope.
Task-number: QTBUG-135244
Pick-to: 6.9
Change-Id: Ibf3fa90ab7db9fcd9811509b5f893aeab4f14925
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Checking required properties had become quite slow, especially on huge
files, after daf57e29de918b7b4be7bb0d469db0c51d41bb07.
Immediatelly checking for the presence of a property binding speeds
things up a lot. fluentwinui3/Slider.qml, which reference a 20k line
file, now compiles almost instantly again instead of talking several
tens of seconds.
Amends daf57e29de918b7b4be7bb0d469db0c51d41bb07
Fixes: QTBUG-135244
Pick-to: 6.9 6.8 6.5
Change-Id: I4391db27f391b179ad03dabadc910f23fa932037
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
We create and increment an iterator and then don't use it...
Amends daf57e29de918b7b4be7bb0d469db0c51d41bb07
Task-number: QTBUG-135244
Pick-to: 6.9 6.8 6.5
Change-Id: Ia92df8e7dc337786eba43980364ad03c747ec11b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Amends daf57e29de918b7b4be7bb0d469db0c51d41bb07 that recurses into
inline components when checking for required properties that were not
set. We should only check inline components that are base types of the
scope, and ignore all inline components in children of the scope.
Fixes: QTBUG-136008
Pick-to: 6.8 6.9
Change-Id: I8c687ce97b3f2eac699e2fd535193197b5239ada
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compiler is very polite and does not tell the user about its useless
code. Codegen::statementList(StatementList *ast) silently discards
unreachable statements during byte code generation.
Warn the user that their code is unreachable. Don't warn about
function definitions because these ones are "hoisted" up,
which means that their definition is supposed to be pushed up, so that
they can be used even if they are behind a "return" or "throw"
statement.
Don't use the qqmljsbasicblock analysis for that, it reports too many
"false positives" where the compiler generates dead code that can't be
fixed by the user.
Task-number: QTBUG-129307
Change-Id: Ia26e8af1adf4e63b26dcaa7fb10be73b7eb084d7
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Warn about functions used before their declaration. Its not technically
an error like the "var used before declaration" because functions are
"hoisted up" and therefore available even before their declaration, so
create a new warning category for it instead of reusing the "var used
before declaration" category. Disable the warning by default: Qt Creator
used to have it as default, while other tools like eslint don't.
For the same reason, don't warn about functions used before declaration
during codegen, and add a method to warn about it in
CodeGenWarningInterface. The code for "var used before declaration"
can be reused by function declarations by adding a sourcelocation for
function declarations in the "addLocalVar"-call, so make sure to
differentiate between functions and vars by adding an extra member to
Context::ResolvedName.
Task-number: QTBUG-129307
Change-Id: I83a4f8cd00c120db23a0cec3365a00ed44de2836
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Qmlls makes QQmlJSImportVisitor re-create a QQmlJSScope when a file gets
updated. It turns out that QQmlJSImportVisitor only works correctly when
used on an empty scopes, methods like rootScopeIsValid() don't work
correctly if the scope is not empty.
Therefore, reset the scopes before making QQmlJSImportVisitor run on
them. Make sure that the internalName and the moduleName are still set.
This fixes a bug where qmlls can't autocomplete an "in-memory" enum
because the import visitor does not set the new enum values in the root
element correctly on an non-empty scope.
Pick-to: 6.8 6.9
Fixes: QTCREATORBUG-32634
Change-Id: If6d620f350215074f87b53bb153363f2dec06145
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is nothing to do in the compiler.
Setting the value of the property is already handled in by the object
creator or the qobjectwrapper.
Reading the value doesn't really makes sense and defeats its purpose .
Fixes: QTBUG-134790
Pick-to: 6.9 6.8
Change-Id: I4576eb528e0dec273830b0244149a92ceb325bc9
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
A revision was also added to the aotstats json format. Print a message
asking the user to try again with a clean build if a missmatch in
revision is found.
Task-number: QTBUG-134790
Pick-to: 6.9 6.8
Change-Id: I0961bf841db17f280492ec787f404d9fe9b563f4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When trying to compile a function in the compiler, sometimes, the
outcome is neither successful compilation nor an error. Introduce
skiping functions for those cases.
When a function is skipped its compilation has not failed. Skipping is
therefore allowed in strict mode.
Task-number: QTBUG-134790
Pick-to: 6.9 6.8
Change-Id: I0f1ca85404db8dd4c87cd5eb9b96c9dc8cc8d290
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
| |
Task-number: QTBUG-134790
Pick-to: 6.9 6.8
Change-Id: Idbba9224d7343b64cb4166e88328029e22c38601
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
| |
The typeName may be incorrect if the property's type is later adjusted.
Task-number: QTBUG-134790
Pick-to: 6.9 6.8
Change-Id: I58c95e873a1d1eb0a2c9d0d0c7b34664d75eadff
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Process all properties of custom parsed types and generate errors if the
custom parsed properties are actually used. Then print an extra error
stating that qmltc does not support custom parsers.
Pick-to: 6.9 6.8
Fixes: QTBUG-134206
Change-Id: I37e4f3f8d0ee4e0926c0d64c99a4a521b093a1ab
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
|
|
| |
We already do this for return types, but it's fatal on any type.
Pick-to: 6.9
Fixes: QTBUG-135342
Change-Id: I7aee2a19ffcd39d2707eceb34b5073057d8b5ebb
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
| |
These headers don't use std::pair at all.
Change-Id: I1c5c5974949ada2e05151e238884ce4f12156b5f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
| |
QPair is just an alias of std::pair anyway.
Task-number: QTBUG-115841
Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
| |
We have QQmlJSUtils::toLiteral() for that. Extend it to handle byte
arrays in addition to strings and use it.
Fixes: QTBUG-134726
Change-Id: Ibde1f56b25794fc8c49b796303c4f39933aedb42
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
|
|
| |
The passes currently don't modify BasicBlocksAndAnnotations, but I think
its nice to not ignore their return value, in case they start modifying
annotations or basic blocks in the future.
Change-Id: I4edcf6958a9a3cf65c91c5389fb42a1dd72d35db
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Modify QQmlJSLinterCodeGen to be able to run BasicBlock analysis. This
is a preparation step to add the unreachable code analysis to
QQmlJSLinterCodeGen.
Task-number: QTBUG-129307
Change-Id: I94ae21759b6b863d9b9c2a632d9c3648ae3eb404
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clean up QQmlJSLinter::lintFile a bit. Add an early exit to decrease the
indent for the qml file linting code.
Remove the huge "check" lambda: instead, create an optional
QQmlJSFileResourceMapper to support both use cases of linting with or
without file resources. This makes the lambda useless, so remove the
calls of the lambda and move the lambda code directly at the caller
site.
Change-Id: Ib268f3e40d945f41710675f2bdb534aa62a599f0
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
It clashes with another "unit" in the same namespace.
Pick-to: 6.9 6.8
Fixes: QTBUG-134911
Change-Id: I4a6eca75fe688f1cf08633af6a68c4481178608d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
| |
Change-Id: I766dc99b8daaeaa64da9075dcfde5dff507c27f2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It doesn't really make sense to print out the location of the variable
declaration, especially in the language server. Instead, emit two
warnings: one at the declaration and one at the usage. This makes it
easier for users to spot the location of the declaration.
Add a test to make sure that both warnings can be disabled with one
disabling directive.
Task-number: QTBUG-129307
Change-Id: Icb485ee37f016f18395c3016672e397c4f5e6024
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow warnings to be emitted in multiple parts, as a preparation step to
have two warnings for "var-used-before-declaration": one of the usage
and one for the declaration.
Added an extra parameter to log that overrides the line number used to
determine whether the current warning is ignored or not. This assumes
that both main and secondary messages both use the same warning
category.
Task-number: QTBUG-129307
Change-Id: I82ed01d417070b13e3c91ea82218e0d858e10d24
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a test for WarnAlreadyFormalParameter that was already implemented
by c4d503be574b56426573e706b70149eb57e52d61.
Amends c4d503be574b56426573e706b70149eb57e52d61 to also implement
WarnAlreadyFunction and WarnAlreadyVar which warns about redeclaring
variables with functions (and vice-versa) in the same JS scope, which
is rejected by the JS runtime.
Also fix the sourcelocation used for functions in JS scopes to be the
identifier location instead of the function keyword.
Task-number: QTBUG-127107
Change-Id: I2f541b8046524ffc642824b1500323d225daed86
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Using an optional lookup '?.' on a base type that cannot be null or
undefined or when looking up an enum value is pointless. We generate a
normal lookup for this in the compiler, but the bytecode keeps these
redundant instructions in.
Task-number: QTBUG-135649
Change-Id: I95d8b4ed22afa1bdc46a3f8b3d60a499d43931ac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
If we can determine that the base of an optional lookup cannot hold null
or undefined, we can simply omit the optional part and generate a
regular get lookup. This is also true whenever we lookup an enum.
Amends fc4ee77116624c784d8c42f2b8e5dbf2f78b6d89
Fixes: QTBUG-135649
Pick-to: 6.9 6.8
Change-Id: I64984fdecc75cd4dbc2274a08aa73b5274fb09b7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
| |
It turns out that <> characters need to be escaped in the dot format.
They are emitted by the `SetUnwindHandler <null>` instruction.
Change-Id: I279cd29cde8501007e388b027c4fe2e9e18ce38c
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Complain about usages of Eval in qmllint, and make the
qqmljstypepropagator analyze eval calls.
Task-number: QTBUG-129307
Change-Id: I577612220383c624e960db60ed755e0f2dbc59aa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit should make implementing small PropertyPasses easier:
instead of having to create a new class and registering the PropertyPass
into the PassManager, create a Builder that creates a PropertyPass from
lambdas and registers it into the pass manager.
This avoids having to create a new class inheriting from PropertyPass
for each check that will be added with QTBUG-129307.
Also add a method to PassManagerPrivate to be able to register
propertypasses on builtin objects. This is needed to warn about usages
of 'eval()' in a later commit.
Task-number: QTBUG-129307
Change-Id: If3ea8d092acae4733aacd62ca7769011f0a7633c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a type with required properties is accessed via a grouped scope, we
can't know whether the object already exists, or whether it would need
to be created.
Avoid false positives and don't emit a warning when we encounter a
grouped property scope, or any non-QML scope. Non-grouped, non-QML
scopes should not trigger the issue, but don't need to be checked
either, avoiding some needless work.
As a drive-by change, don't put spaces into a data test tag (which does
not play nice with running the test separately).
Amends daf57e29de918b7b4be7bb0d469db0c51d41bb07
Pick-to: 6.8 6.9 6.5
Fixes: QTBUG-134887
Change-Id: I747239c5d72993cf9a1563c875cefaf89c8e52a2
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
|
| |
|
|
|
|
|
|
| |
Complain about ids in qmllint that start with an upper case letter.
Task-number: QTBUG-129307
Change-Id: I4cee3201d369692ead60cfcdebacf587b6d73491
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Add a private helper method emitWarningWithOptionalFix to emit
warnings with optional fix suggestions.
Task-number: QTBUG-129307
Change-Id: Ifdcb3ccac8c857f06d3ccb658042b8376283fb26
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Make qmllint complain about bad qmldirs: don't ignore warnings emitted
by qqmldirparser, and adapt a test where a missing trailing `/` in a
prefer directive leads to a test failure because of a qqmldirparser
warning that now gets emitted by qmllint.
Pick-to: 6.8 6.9
Change-Id: I85f0dd53ba887d1f01ce9ef9a9475d58e3f97208
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Add a few cases to checkedInputRegister() such that
qqmljstypepropagator does not assert when processing eval calls.
Pick-to: 6.5 6.8 6.9
Task-number: QTBUG-129307
Change-Id: I2d10799051e59fb3597966992fd8aa7c85ed2545
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
It generally makes no sense to continue with the instruction after we've
detected an unrecoverable problem. Replace all reject() calls with a
macro that also returns right away.
Task-number: QTBUG-135288
Change-Id: I767318d5dc1e8e12c35e5ecbc04375cbf7d17016
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
| |
Change-Id: Ib9287352142fe3820d9b31d7423d3c34ca370046
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We've resolved the value type in the type propagator. Trying to do it
again in the code generator, after the iterator may have been adjusted,
is quite wrong. If we resolve the list value type on a type that's not
a list (anymore), then we get an invalid type, which subsequently
crashes.
Amends commit a173d50a9e54d2a21a5207f6c66bb54bb8f3a612.
Pick-to: 6.9 6.8
Fixes: QTBUG-135288
Change-Id: I1227803ed100c83f8fc11898be0a4d0199d639dd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
A ternary decays the arguments to raw pointers (instead of being char
arrays), and that pessimizes the codegen because QStringView has to call
strlen() again to figure out the lengths of the strings. Just use
QStringView's UDL.
Change-Id: Ibbd956c54385d6955f7ac305d5c14f4892bfcc96
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Added some macros to static_assert that the logging categories are
unique in name, settings name and description. This excludes empty
strings.
A duplicate description was already found and fixed thanks to this.
Change-Id: I9fd689065f5bb3a567143ed78211800f88543408
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|