aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-10-30 13:27:43 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-01 23:01:24 +0100
commit2c078cc2912275c6b83be1f9670fb455e25ad7b6 (patch)
treeeb8dc50e6099fbd3359851f0c8f315714ac9fa81 /src/qml/compiler
parentb7f6382b1ea7b2d7e90dbbc2510780f84c18f79b (diff)
Improve debugging of QML expressions
Add the name of the property to the generated IR function ("expression for x") to make it easier to debug. Change-Id: If35f42764774e6d7f40d3bf080e1fbdb12321ed5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r--src/qml/compiler/qqmlcodegenerator.cpp4
-rw-r--r--src/qml/compiler/qqmlcodegenerator_p.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp
index 51a4961050..546c92cd04 100644
--- a/src/qml/compiler/qqmlcodegenerator.cpp
+++ b/src/qml/compiler/qqmlcodegenerator.cpp
@@ -1226,7 +1226,7 @@ void JSCodeGen::beginObjectScope(QQmlPropertyCache *scopeObject)
_scopeObject = scopeObject;
}
-QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings(const QList<AST::Node*> &functions)
+QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings(const QList<AST::Node*> &functions, const QHash<int, QString> &functionNames)
{
QVector<int> runtimeFunctionIndices(functions.size());
@@ -1257,7 +1257,7 @@ QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings(const QList<AST::N
if (function)
name = function->name.toString();
else
- name = QStringLiteral("%qml-expression-entry");
+ name = functionNames.value(i, QStringLiteral("%qml-expression-entry"));
AST::SourceElements *body;
if (function)
diff --git a/src/qml/compiler/qqmlcodegenerator_p.h b/src/qml/compiler/qqmlcodegenerator_p.h
index d077bff6db..1cc5b1e2f6 100644
--- a/src/qml/compiler/qqmlcodegenerator_p.h
+++ b/src/qml/compiler/qqmlcodegenerator_p.h
@@ -362,7 +362,7 @@ struct Q_QML_EXPORT JSCodeGen : public QQmlJS::Codegen
void beginObjectScope(QQmlPropertyCache *scopeObject);
// Returns mapping from input functions to index in V4IR::Module::functions / compiledData->runtimeFunctions
- QVector<int> generateJSCodeForFunctionsAndBindings(const QList<AST::Node*> &functions);
+ QVector<int> generateJSCodeForFunctionsAndBindings(const QList<AST::Node*> &functions, const QHash<int, QString> &functionNames);
// Resolve QObject members with the help of QQmlEngine's meta type registry
virtual V4IR::Expr *member(V4IR::Expr *base, const QString *name);