summaryrefslogtreecommitdiff
path: root/src/qmlcompiler/qqmljscompiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler.cpp')
-rw-r--r--src/qmlcompiler/qqmljscompiler.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp
index 938d1d68d6..6412f47d38 100644
--- a/src/qmlcompiler/qqmljscompiler.cpp
+++ b/src/qmlcompiler/qqmljscompiler.cpp
@@ -243,6 +243,21 @@ bool qCompileQmlFile(const QString &inputFileName, QQmlJSSaveFunction saveFuncti
aotFunctionsByIndex[runtimeFunctionIndices[binding.value.compiledScriptIndex]] = *func;
}
});
+
+ std::for_each(object->functionsBegin(), object->functionsEnd(),
+ [&](const QmlIR::Function &function) {
+
+ qCDebug(lcAotCompiler) << "Compiling function"
+ << irDocument.stringAt(function.nameIndex);
+ auto result = aotCompiler->compileFunction(function);
+ if (auto *error = std::get_if<QQmlJS::DiagnosticMessage>(&result)) {
+ qCDebug(lcAotCompiler) << "Could not compile function:"
+ << diagnosticErrorMessage(inputFileName, *error);
+ } else if (auto *func = std::get_if<QQmlJSAotFunction>(&result)) {
+ qCInfo(lcAotCompiler) << "Generated code:" << func->code;
+ aotFunctionsByIndex[runtimeFunctionIndices[function.index]] = *func;
+ }
+ });
}
if (!checkArgumentsObjectUseInSignalHandlers(irDocument, error)) {