diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-04-27 09:20:53 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-04-28 09:43:36 +0200 |
commit | 432f651439465d2f9f56c61c2466a7b2b846169d (patch) | |
tree | b4987a271ac65e5f83e52dca726799cf6156a5fb /tools | |
parent | 4a6cabf3ebbf1fd25916e5085d2be4f79a44ed22 (diff) |
QmltcTypeResolver: Take visitor as pointer
We generally avoid passing arguments as non-const reference.
Change-Id: I3d2d7ba372f487af71d2478b6238be0756ed4ae0
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmltc/main.cpp | 2 | ||||
-rw-r--r-- | tools/qmltc/qmltctyperesolver.cpp | 8 | ||||
-rw-r--r-- | tools/qmltc/qmltctyperesolver.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/tools/qmltc/main.cpp b/tools/qmltc/main.cpp index bb616689b9..c8d62ba078 100644 --- a/tools/qmltc/main.cpp +++ b/tools/qmltc/main.cpp @@ -201,7 +201,7 @@ int main(int argc, char **argv) QmltcVisitor visitor(&importer, &logger, QQmlJSImportVisitor::implicitImportDirectory(url, &mapper), qmldirFiles); QmltcTypeResolver typeResolver { &importer }; - typeResolver.init(visitor, document.program); + typeResolver.init(&visitor, document.program); if (logger.hasErrors()) return EXIT_FAILURE; diff --git a/tools/qmltc/qmltctyperesolver.cpp b/tools/qmltc/qmltctyperesolver.cpp index faf2b431e4..594a986990 100644 --- a/tools/qmltc/qmltctyperesolver.cpp +++ b/tools/qmltc/qmltctyperesolver.cpp @@ -39,14 +39,14 @@ Q_LOGGING_CATEGORY(lcTypeResolver2, "qml.qmltc.typeresolver", QtInfoMsg); -void QmltcTypeResolver::init(QmltcVisitor &visitor, QQmlJS::AST::Node *program) +void QmltcTypeResolver::init(QmltcVisitor *visitor, QQmlJS::AST::Node *program) { - QQmlJSTypeResolver::init(&visitor, program); + QQmlJSTypeResolver::init(visitor, program); QQmlJSLiteralBindingCheck literalCheck; - literalCheck.run(&visitor, this); + literalCheck.run(visitor, this); - m_root = visitor.result(); + m_root = visitor->result(); QQueue<QQmlJSScope::Ptr> objects; objects.enqueue(m_root); diff --git a/tools/qmltc/qmltctyperesolver.h b/tools/qmltc/qmltctyperesolver.h index ae9e98c23e..b8c79bbe90 100644 --- a/tools/qmltc/qmltctyperesolver.h +++ b/tools/qmltc/qmltctyperesolver.h @@ -46,7 +46,7 @@ public: Q_ASSERT(importer); } - void init(QmltcVisitor &visitor, QQmlJS::AST::Node *program); + void init(QmltcVisitor *visitor, QQmlJS::AST::Node *program); // TODO: this shouldn't be exposed. instead, all the custom passes on // QQmlJSScope types must happen inside Visitor |