diff options
author | Antti Piira <[email protected]> | 2013-09-24 12:49:10 -0700 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-10-21 21:43:32 +0200 |
commit | 9de3630a513aa598855f7d40461c5aec9ecce319 (patch) | |
tree | 69eb5b78efbfe6cba7b7266a9adbe0e2bce77336 /src/qml/compiler/qv4compileddata_p.h | |
parent | de31a57672ec461c2081f65e3631134ee45de887 (diff) |
Add support CompositeSingleton to the new V4 compiler.v5.2.0-beta1
Implements QQmlCodeGenerator::visit(AST::UiPragma *) to process any
pragma statements in a QML file for the new V4 compiler approach.
Only pragma Singleton is supported, others will generate errors.
Also adds necessary hooks to treat types as Singletons. Basic
functionality is working, but three of the QML Singleton unit tests
fail. Some of them are dependent on other language capabilities that
seem to have problems.
In addition removes unnecessary toString() call in the equivalent
visit(AST::UiPragma *) function of the old parser.
Change-Id: Iec9fa887f953b80b7f9a11878d846637a8f519ef
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index bf6794e182..2c0a46f3c5 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -148,7 +148,8 @@ struct Unit enum { IsJavascript = 0x1, IsQml = 0x2, - StaticData = 0x4 // Unit data persistent in memory? + StaticData = 0x4, // Unit data persistent in memory? + IsSingleton = 0x8 }; quint32 flags; uint stringTableSize; @@ -414,7 +415,6 @@ struct Import Location location; }; - struct QmlUnit { Unit header; @@ -433,6 +433,10 @@ struct QmlUnit const uint offset = offsetTable[idx]; return reinterpret_cast<const Object*>(reinterpret_cast<const char*>(this) + offset); } + + bool isSingleton() const { + return header.flags & Unit::IsSingleton; + } }; // This is how this hooks into the existing structures: |