summaryrefslogtreecommitdiff
path: root/src/qml/compiler/qv4bytecodegenerator.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-06-16 22:50:50 +0200
committerLars Knoll <lars.knoll@qt.io>2017-06-20 10:04:19 +0000
commita14407ca599eae8e1b7a119bdba082abe51a17f2 (patch)
treec73dec21ea547ada818d269cc016db2b82a7eef7 /src/qml/compiler/qv4bytecodegenerator.cpp
parent5da34373d46d17f2950a4beeb3b78d6edcb208e9 (diff)
downloadqtdeclarative-a14407ca599eae8e1b7a119bdba082abe51a17f2.tar.gz
Get back some line number information
Change-Id: I7d7845a9d8d147bd363c0f60df41066fab355272 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4bytecodegenerator.cpp')
-rw-r--r--src/qml/compiler/qv4bytecodegenerator.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator.cpp b/src/qml/compiler/qv4bytecodegenerator.cpp
index 6ccdeef777..ed58833b25 100644
--- a/src/qml/compiler/qv4bytecodegenerator.cpp
+++ b/src/qml/compiler/qv4bytecodegenerator.cpp
@@ -39,11 +39,22 @@
#include <private/qv4bytecodegenerator_p.h>
#include <private/qv4jsir_p.h>
+#include <private/qqmljsastfwd_p.h>
QT_USE_NAMESPACE
using namespace QV4;
using namespace Moth;
+void BytecodeGenerator::setLocation(const QQmlJS::AST::SourceLocation &loc)
+{
+ if (static_cast<int>(loc.startLine) == currentLine)
+ return;
+ currentLine = static_cast<int>(loc.startLine);
+ Instruction::Line line;
+ line.lineNumber = currentLine;
+ addInstruction(line);
+}
+
unsigned BytecodeGenerator::newTemp()
{
int t = function->currentTemp++;