diff options
| author | Olivier De Cannière <olivier.decanniere@qt.io> | 2024-08-02 10:13:44 +0200 |
|---|---|---|
| committer | Olivier De Cannière <olivier.decanniere@qt.io> | 2024-08-21 19:57:58 +0200 |
| commit | d70abd83dc94d722cde6d4b19b9d35c5f4f19946 (patch) | |
| tree | 1119f20b6f64d71b4602e7d4e39f7dc0c2caeec4 /src/qmlcompiler/qqmljscompiler_p.h | |
| parent | 06577c9e80eb150b6b9e76e7805bfed1abbae82d (diff) | |
Compiler: Create infrastructure to support multiple warnings
Currently only one DiagnosticMessage can be stored at a time when using
the compiler. However, we want to be able to show more than one to the
user.
Therefore, use a list that gets passed inside the compiler instead of a
pointer to the sole error.
This also means that the error is valid by its very existence. There is
no need to check validity explicitly anymore.
Task-number: QTBUG-127624
Change-Id: I356db917b86703b508dc1ad52de7825d82eafd71
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler_p.h')
| -rw-r--r-- | src/qmlcompiler/qqmljscompiler_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qmlcompiler/qqmljscompiler_p.h b/src/qmlcompiler/qqmljscompiler_p.h index 94cf71b884..2e08834eca 100644 --- a/src/qmlcompiler/qqmljscompiler_p.h +++ b/src/qmlcompiler/qqmljscompiler_p.h @@ -70,10 +70,10 @@ public: virtual void setDocument(const QmlIR::JSCodeGen *codegen, const QmlIR::Document *document); virtual void setScope(const QmlIR::Object *object, const QmlIR::Object *scope); - virtual std::variant<QQmlJSAotFunction, QQmlJS::DiagnosticMessage> compileBinding( + virtual std::variant<QQmlJSAotFunction, QList<QQmlJS::DiagnosticMessage>> compileBinding( const QV4::Compiler::Context *context, const QmlIR::Binding &irBinding, QQmlJS::AST::Node *astNode); - virtual std::variant<QQmlJSAotFunction, QQmlJS::DiagnosticMessage> compileFunction( + virtual std::variant<QQmlJSAotFunction, QList<QQmlJS::DiagnosticMessage>> compileFunction( const QV4::Compiler::Context *context, const QString &name, QQmlJS::AST::Node *astNode); virtual QQmlJSAotFunction globalCode() const; @@ -100,10 +100,10 @@ protected: private: QQmlJSAotFunction doCompile(const QV4::Compiler::Context *context, QQmlJSCompilePass::Function *function, - QQmlJS::DiagnosticMessage *error); + QList<QQmlJS::DiagnosticMessage> *error); QQmlJSAotFunction doCompileAndRecordAotStats(const QV4::Compiler::Context *context, QQmlJSCompilePass::Function *function, - QQmlJS::DiagnosticMessage *error, + QList<QQmlJS::DiagnosticMessage> *erros, const QString &name, QQmlJS::SourceLocation location); }; |
