From 56f29d005c2c6eb028e3ed2d1ef8edd6d03d1403 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 12 Jun 2017 10:27:54 +0200 Subject: 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 --- tools/qmlcachegen/qmlcachegen.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools') 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 jsErrors = v4CodeGen.errors(); if (!jsErrors.isEmpty()) { -- cgit v1.2.3