diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-21 13:39:43 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-22 13:11:27 +0200 |
commit | c0063f73e5472f770133602ea2a7c6fe77f5a1b3 (patch) | |
tree | 1c756a84849ba8fca1a7ba2b6fc812643518e55d /src/qml/compiler/qqmlirbuilder_p.h | |
parent | ebef555f49628c247cdb1fde22ddec560c7fb852 (diff) |
QmlIR: Make sure that all objects receive a location
For grouped properties, this is the location of binding now.
Change-Id: I7148ba92150e3569d47c382ef78794bfa3b75fce
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder_p.h')
-rw-r--r-- | src/qml/compiler/qqmlirbuilder_p.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h index 7e6c8c1272..058f9802ae 100644 --- a/src/qml/compiler/qqmlirbuilder_p.h +++ b/src/qml/compiler/qqmlirbuilder_p.h @@ -371,7 +371,7 @@ public: // specified object. Used for declarations inside group properties. Object *declarationsOverride; - void init(QQmlJS::MemoryPool *pool, int typeNameIndex, int idIndex, const QQmlJS::SourceLocation &location = QQmlJS::SourceLocation()); + void init(QQmlJS::MemoryPool *pool, int typeNameIndex, int idIndex, const QV4::CompiledData::Location &location); QString appendEnum(Enum *enumeration); QString appendSignal(Signal *signal); @@ -492,9 +492,21 @@ public: void accept(QQmlJS::AST::Node *node); // returns index in _objects - bool defineQMLObject(int *objectIndex, QQmlJS::AST::UiQualifiedId *qualifiedTypeNameId, const QQmlJS::SourceLocation &location, QQmlJS::AST::UiObjectInitializer *initializer, Object *declarationsOverride = nullptr); - bool defineQMLObject(int *objectIndex, QQmlJS::AST::UiObjectDefinition *node, Object *declarationsOverride = nullptr) - { return defineQMLObject(objectIndex, node->qualifiedTypeNameId, node->qualifiedTypeNameId->firstSourceLocation(), node->initializer, declarationsOverride); } + bool defineQMLObject( + int *objectIndex, QQmlJS::AST::UiQualifiedId *qualifiedTypeNameId, + const QV4::CompiledData::Location &location, + QQmlJS::AST::UiObjectInitializer *initializer, Object *declarationsOverride = nullptr); + + bool defineQMLObject( + int *objectIndex, QQmlJS::AST::UiObjectDefinition *node, + Object *declarationsOverride = nullptr) + { + const QQmlJS::SourceLocation location = node->qualifiedTypeNameId->firstSourceLocation(); + return defineQMLObject( + objectIndex, node->qualifiedTypeNameId, + { location.startLine, location.startColumn }, node->initializer, + declarationsOverride); + } static QString asString(QQmlJS::AST::UiQualifiedId *node); QStringView asStringRef(QQmlJS::AST::Node *node); |