aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-09-07 09:59:26 +0200
committerUlf Hermann <ulf.hermann@qt.io>2023-09-08 22:27:52 +0200
commit1bd18723f72b451d3c5abf4560b4dd31394e5243 (patch)
treeef914367f9a84eadaf2d0cd12ed6e147a590e938 /src/qml/compiler/qv4codegen.cpp
parentf716d3d71a9c82d98d4afb44662d0c4e41a86203 (diff)
QtQml: Add more fine grained logging categories for qv4codegen.cpp
We want to control the warnings about variables used before declaration and injected signal parameters separately, and they are not necessarily part of the compiler warnings. Fixes: QTBUG-116764 Change-Id: If3f28f99b539a069cbdb7854d701c027debc77be Reviewed-by: Andreas Aardal Hanssen <andrhans@cisco.com> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 6cedf906c0..aba071580b 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -31,7 +31,8 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
-Q_LOGGING_CATEGORY(lcQmlCompiler, "qt.qml.compiler");
+Q_LOGGING_CATEGORY(lcQmlUsedBeforeDeclared, "qt.qml.usedbeforedeclared");
+Q_LOGGING_CATEGORY(lcQmlInjectedParameter, "qt.qml.injectedparameter");
using namespace QV4;
using namespace QV4::Compiler;
@@ -42,7 +43,7 @@ void CodegenWarningInterface::reportVarUsedBeforeDeclaration(
const QString &name, const QString &fileName, QQmlJS::SourceLocation declarationLocation,
QQmlJS::SourceLocation accessLocation)
{
- qCWarning(lcQmlCompiler).nospace().noquote()
+ qCWarning(lcQmlUsedBeforeDeclared).nospace().noquote()
<< fileName << ":" << accessLocation.startLine << ":" << accessLocation.startColumn
<< " Variable \"" << name << "\" is used before its declaration at "
<< declarationLocation.startLine << ":" << declarationLocation.startColumn << ".";
@@ -2609,7 +2610,7 @@ Codegen::Reference Codegen::referenceForName(const QString &name, bool isLhs, co
}
if (resolved.isInjected && accessLocation.isValid()) {
- qCWarning(lcQmlCompiler).nospace().noquote()
+ qCWarning(lcQmlInjectedParameter).nospace().noquote()
<< url().toString() << ":" << accessLocation.startLine
<< ":" << accessLocation.startColumn << " Parameter \"" << name
<< "\" is not declared."