diff options
| author | Andrei Golubev <andrei.golubev@qt.io> | 2021-02-23 12:44:46 +0100 |
|---|---|---|
| committer | Andrei Golubev <andrei.golubev@qt.io> | 2021-02-23 14:33:09 +0100 |
| commit | 500b8b9f5dc773f8b7b6ef73637ec0fb7f3bece4 (patch) | |
| tree | 11bded9ff8124a5a897f1579a7fad98f5e09415d /src/qmlcompiler/qqmljscompiler.cpp | |
| parent | 1e089ad28dae8b86c2e7e3022b09b976e0ee7b80 (diff) | |
Add qCompileQmlFile overload with QmlIR::Document as in/out parameter
QML compiler doesn't quite follow QQmlJSAotCompiler interface
conventions and it's unclear if it can/should. However, it works with
a populated QmlIR::Document and must really share the setup logic with
some existing code. Thus, a new version of qCompileQmlFile is introduced
that accepts QmlIR::Document as parameter to allow to use the set
document afterwards. This way we can share the same code paths between
qmlcachegen and qmlcompiler POC
(and maybe even qmlcachegenplus could benefit)
Task-number: QTBUG-84368
Change-Id: I4b662644a54e494a80224fe8512e3055952692c0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljscompiler.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp index 1b6583ccf6..bf5330a6b8 100644 --- a/src/qmlcompiler/qqmljscompiler.cpp +++ b/src/qmlcompiler/qqmljscompiler.cpp @@ -196,7 +196,13 @@ bool qCompileQmlFile(const QString &inputFileName, QQmlJSSaveFunction saveFuncti QQmlJSAotCompiler *aotCompiler, QQmlJSCompileError *error) { QmlIR::Document irDocument(/*debugMode*/false); + return qCompileQmlFile(irDocument, inputFileName, saveFunction, aotCompiler, error); +} +bool qCompileQmlFile(QmlIR::Document &irDocument, const QString &inputFileName, + QQmlJSSaveFunction saveFunction, QQmlJSAotCompiler *aotCompiler, + QQmlJSCompileError *error) +{ QString sourceCode; { QFile f(inputFileName); |
