aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljscompiler_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-01-20 18:08:23 +0100
committerUlf Hermann <ulf.hermann@qt.io>2025-02-02 13:59:44 +0100
commit13cb5754b229679f27be3d0376e029e4c7fd07b9 (patch)
tree5d7b225dee2b2554b29f8c1cc4fbaf1f60ebc7b3 /src/qmlcompiler/qqmljscompiler_p.h
parent711b643d5cff068794879698b2fe6ae6a4be8c2c (diff)
QmlCompiler: Clean up error handling
We should only have one way to handle diagnostic messages: The QQmlJSLogger. In addition each compile pass may result in an error that prevents the running of further passes. But that error should not rely on the selection of messages posted earlier. For this to work we need to introduce a further state transition into the logger. The logger now "archives" messages after compiling each function, so that only the current function's compile errors are taken into account as result of the current function's compilation. Task-number: QTBUG-124913 Change-Id: I4b6d9910b80527cefb1aba02598114d1fe5ba172 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler_p.h')
-rw-r--r--src/qmlcompiler/qqmljscompiler_p.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/qmlcompiler/qqmljscompiler_p.h b/src/qmlcompiler/qqmljscompiler_p.h
index 2e08834eca..4f2a04ba48 100644
--- a/src/qmlcompiler/qqmljscompiler_p.h
+++ b/src/qmlcompiler/qqmljscompiler_p.h
@@ -81,6 +81,8 @@ public:
Flags m_flags;
protected:
+ std::optional<QList<QQmlJS::DiagnosticMessage>> finalizeBindingOrFunction();
+
virtual QQmlJS::DiagnosticMessage diagnose(
const QString &message, QtMsgType type, const QQmlJS::SourceLocation &location) const;
@@ -98,14 +100,11 @@ protected:
QQmlJSLogger *m_logger = nullptr;
private:
- QQmlJSAotFunction doCompile(const QV4::Compiler::Context *context,
- QQmlJSCompilePass::Function *function,
- QList<QQmlJS::DiagnosticMessage> *error);
- QQmlJSAotFunction doCompileAndRecordAotStats(const QV4::Compiler::Context *context,
- QQmlJSCompilePass::Function *function,
- QList<QQmlJS::DiagnosticMessage> *erros,
- const QString &name,
- QQmlJS::SourceLocation location);
+ QQmlJSAotFunction doCompile(
+ const QV4::Compiler::Context *context, QQmlJSCompilePass::Function *function);
+ QQmlJSAotFunction doCompileAndRecordAotStats(
+ const QV4::Compiler::Context *context, QQmlJSCompilePass::Function *function,
+ const QString &name, QQmlJS::SourceLocation location);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QQmlJSAotCompiler::Flags);