aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qqmlirbuilder_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-03-12 16:55:06 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-23 21:16:46 +0200
commita885d10a0289da85b8c966d2fa40fb10edae4fd7 (patch)
tree7c16b5abd88d436f6596d6a424126c1b1dd2aba8 /src/qml/compiler/qqmlirbuilder_p.h
parent937fdde5d3b26291d417f856ee05ba479a6ba730 (diff)
Extend the QML bootstrap library by the IR builders
This is among other things needed to fix the qml import scanner to detect dependencies from .js files correctly. The patch also fixes the use of Q_QML_EXPORT towards Q_QML_PRIVATE_EXPORT where appropriate and corrects the wrong include path for the double conversion code to actually be relative to the file it is included from. This worked by accident because of other include paths present in the build. Change-Id: I338583dad2f76300819af8ab0dae8e5724c84430 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder_p.h')
-rw-r--r--src/qml/compiler/qqmlirbuilder_p.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h
index 4ea7e05639..3ea6baff2e 100644
--- a/src/qml/compiler/qqmlirbuilder_p.h
+++ b/src/qml/compiler/qqmlirbuilder_p.h
@@ -49,12 +49,16 @@
#include <private/qqmljsmemorypool_p.h>
#include <private/qv4codegen_p.h>
#include <private/qv4compiler_p.h>
-#include <private/qqmlpropertycache_p.h>
#include <QTextStream>
#include <QCoreApplication>
+#ifndef V4_BOOTSTRAP
+#include <private/qqmlpropertycache_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
+class QQmlPropertyCache;
class QQmlContextData;
class QQmlTypeNameCache;
@@ -247,7 +251,7 @@ struct Q_QML_EXPORT CompiledFunctionOrExpression
CompiledFunctionOrExpression *next;
};
-struct Q_QML_EXPORT Object
+struct Q_QML_PRIVATE_EXPORT Object
{
Q_DECLARE_TR_FUNCTIONS(Object)
public:
@@ -297,7 +301,7 @@ private:
PoolList<Function> *functions;
};
-struct Q_QML_EXPORT Pragma
+struct Q_QML_PRIVATE_EXPORT Pragma
{
enum PragmaType {
PragmaSingleton = 0x1
@@ -307,7 +311,7 @@ struct Q_QML_EXPORT Pragma
QV4::CompiledData::Location location;
};
-struct Q_QML_EXPORT Document
+struct Q_QML_PRIVATE_EXPORT Document
{
Document(bool debugMode);
QString code;
@@ -330,16 +334,16 @@ struct Q_QML_EXPORT Document
int registerString(const QString &str) { return jsGenerator.registerString(str); }
QString stringAt(int index) const { return jsGenerator.stringForIndex(index); }
- void extractScriptMetaData(QString &script, QQmlError *error);
+ void extractScriptMetaData(QString &script, QQmlJS::DiagnosticMessage *error);
static void removeScriptPragmas(QString &script);
};
-struct Q_QML_EXPORT IRBuilder : public QQmlJS::AST::Visitor
+struct Q_QML_PRIVATE_EXPORT IRBuilder : public QQmlJS::AST::Visitor
{
Q_DECLARE_TR_FUNCTIONS(QQmlCodeGenerator)
public:
IRBuilder(const QSet<QString> &illegalNames);
- bool generateFromQml(const QString &code, const QUrl &url, const QString &urlString, Document *output);
+ bool generateFromQml(const QString &code, const QString &url, const QString &urlString, Document *output);
static bool isSignalPropertyName(const QString &name);
@@ -401,7 +405,7 @@ public:
static bool isStatementNodeScript(QQmlJS::AST::Statement *statement);
- QList<QQmlError> errors;
+ QList<QQmlJS::DiagnosticMessage> errors;
QSet<QString> illegalNames;
@@ -416,11 +420,11 @@ public:
QQmlJS::MemoryPool *pool;
QString sourceCode;
- QUrl url;
+ QString url;
QV4::Compiler::JSUnitGenerator *jsGenerator;
};
-struct Q_QML_EXPORT QmlUnitGenerator
+struct Q_QML_PRIVATE_EXPORT QmlUnitGenerator
{
QV4::CompiledData::QmlUnit *generate(Document &output);
@@ -429,6 +433,7 @@ private:
char *writeBindings(char *bindingPtr, Object *o, BindingFilter filter) const;
};
+#ifndef V4_BOOTSTRAP
struct Q_QML_EXPORT PropertyResolver
{
PropertyResolver(QQmlPropertyCache *cache)
@@ -447,8 +452,9 @@ struct Q_QML_EXPORT PropertyResolver
QQmlPropertyCache *cache;
};
+#endif
-struct Q_QML_EXPORT JSCodeGen : public QQmlJS::Codegen
+struct Q_QML_PRIVATE_EXPORT JSCodeGen : public QQmlJS::Codegen
{
JSCodeGen(const QString &fileName, const QString &sourceCode, QV4::IR::Module *jsModule,
QQmlJS::Engine *jsEngine, QQmlJS::AST::UiProgram *qmlRoot, QQmlTypeNameCache *imports,