summaryrefslogtreecommitdiff
path: root/src/qmlcompiler/qqmljscompiler.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-02-22 11:06:54 +0100
committerUlf Hermann <ulf.hermann@qt.io>2023-02-23 12:25:48 +0100
commitab9f4d2e2614d693c254a027a28824e83c7760f0 (patch)
treeddc6e1b239d9341ef79aa996b661ccf70b843a61 /src/qmlcompiler/qqmljscompiler.cpp
parent7bf2bddd1f848237dc48dc2240c47f356596ca18 (diff)
downloadqtdeclarative-ab9f4d2e2614d693c254a027a28824e83c7760f0.tar.gz
QmlCompiler: Drop broken line comments in generated C++
They didn't work because the ordering of instructions is not the same as the ordering of lines. They also weren't very helpful because a single line may result in multiple instructions and vice versa. On top of everything, they also introduced UB via the std::upper_bound call. Rather, just print the name of the function and the place in the file at the beginning of each C++ function. That is much more helpful since we can then just correlate it to the original QML code. For instruction-by-instruction mapping we have to consult the byte code trace anyway. Pick-to: 6.5 6.4 6.2 Fixes: QTBUG-111340 Change-Id: I599ce384cfaf88a7347583a55976a3b98080435d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler.cpp')
-rw-r--r--src/qmlcompiler/qqmljscompiler.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp
index 964c01c1a2..700bdb0d50 100644
--- a/src/qmlcompiler/qqmljscompiler.cpp
+++ b/src/qmlcompiler/qqmljscompiler.cpp
@@ -650,7 +650,6 @@ void QQmlJSAotCompiler::setDocument(
m_logger->setFileName(resourcePathInfo.fileName());
m_logger->setCode(irDocument->code);
m_unitGenerator = &irDocument->jsGenerator;
- m_entireSourceCodeLines = irDocument->code.split(u'\n');
QQmlJSScope::Ptr target = QQmlJSScope::create();
QQmlJSImportVisitor visitor(target, m_importer, m_logger,
resourcePathInfo.canonicalPath() + u'/',
@@ -796,8 +795,7 @@ QQmlJSAotFunction QQmlJSAotCompiler::doCompile(
return compileError();
QQmlJSCodeGenerator codegen(
- context, m_unitGenerator, &m_typeResolver, m_logger,
- m_entireSourceCodeLines);
+ context, m_unitGenerator, &m_typeResolver, m_logger);
QQmlJSAotFunction result = codegen.run(function, &typePropagationResult, error);
return error->isValid() ? compileError() : result;
}