aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-06-12 10:27:54 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-06-19 12:50:37 +0000
commit56f29d005c2c6eb028e3ed2d1ef8edd6d03d1403 (patch)
treee8a2503ba9f50c7797e16eeb96e444617b54ec18 /tools
parent6f2bdb816dc816461cf3888eb732f71904b6a7ab (diff)
Pass the JSUnitGenerator into the codegen
Allow registering all the required data to generate the proper compilationunit already in the codegenerator. Change-Id: I36345cc01927b3f8dc3ba6d91da175bd6abe124a Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlcachegen/qmlcachegen.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp
index b201176d5e..6bc199ee6b 100644
--- a/tools/qmlcachegen/qmlcachegen.cpp
+++ b/tools/qmlcachegen/qmlcachegen.cpp
@@ -149,7 +149,10 @@ static bool compileQmlFile(const QString &inputFileName, const QString &outputFi
annotateListElements(&irDocument);
{
- QmlIR::JSCodeGen v4CodeGen(/*empty input file name*/QString(), irDocument.code, &irDocument.jsModule, &irDocument.jsParserEngine, irDocument.program, /*import cache*/0, &irDocument.jsGenerator.stringTable);
+ QmlIR::JSCodeGen v4CodeGen(/*empty input file name*/QString(), irDocument.code,
+ &irDocument.jsGenerator, &irDocument.jsModule,
+ &irDocument.jsParserEngine, irDocument.program,
+ /*import cache*/0, &irDocument.jsGenerator.stringTable);
for (QmlIR::Object *object: qAsConst(irDocument.objects)) {
if (object->functionsAndExpressions->count == 0)
continue;
@@ -253,7 +256,10 @@ static bool compileJSFile(const QString &inputFileName, const QString &outputFil
}
{
- QmlIR::JSCodeGen v4CodeGen(inputFileName, irDocument.code, &irDocument.jsModule, &irDocument.jsParserEngine, irDocument.program, /*import cache*/0, &irDocument.jsGenerator.stringTable);
+ QmlIR::JSCodeGen v4CodeGen(inputFileName, irDocument.code, &irDocument.jsGenerator,
+ &irDocument.jsModule, &irDocument.jsParserEngine,
+ irDocument.program, /*import cache*/0,
+ &irDocument.jsGenerator.stringTable);
v4CodeGen.generateFromProgram(/*empty input file name*/QString(), sourceCode, program, &irDocument.jsModule, QQmlJS::Codegen::GlobalCode);
QList<QQmlJS::DiagnosticMessage> jsErrors = v4CodeGen.errors();
if (!jsErrors.isEmpty()) {