aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsstoragegeneralizer.cpp
diff options
context:
space:
mode:
authorOlivier De Cannière <[email protected]>2024-03-04 09:45:34 +0100
committerOlivier De Cannière <[email protected]>2024-04-19 20:00:56 +0200
commit4619377409f28f35cfd9bf0f6ed2bd1094e66c16 (patch)
tree1a6ff446c04120e25797af4b4ddca29fc6ea11c6 /src/qmlcompiler/qqmljsstoragegeneralizer.cpp
parent79c3fb123d166f1eb355e064ee6cc6aca0e4749a (diff)
Compiler: Extract Basic blocks generation into its own compiler pass
The old basic blocks pass was responsible for two things: the basic blocks generation and dead code analysis/type adjustments based on those blocks and the type propagation performed earlier. Now the basic blocks get generated first, even before the type propagation and the dead code analysis and type adjustments are now grouped in a pass called QQmlJSOptimizations. The rest of the passes remain unchanged. Change-Id: I7b4303eaf67c761a49b82ab194e5d035d24d2615 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
Diffstat (limited to 'src/qmlcompiler/qqmljsstoragegeneralizer.cpp')
-rw-r--r--src/qmlcompiler/qqmljsstoragegeneralizer.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qmlcompiler/qqmljsstoragegeneralizer.cpp b/src/qmlcompiler/qqmljsstoragegeneralizer.cpp
index 543dec9ff6..077c1dcc01 100644
--- a/src/qmlcompiler/qqmljsstoragegeneralizer.cpp
+++ b/src/qmlcompiler/qqmljsstoragegeneralizer.cpp
@@ -19,9 +19,8 @@ QT_BEGIN_NAMESPACE
* operates only on the annotations and the function description.
*/
-QQmlJSCompilePass::InstructionAnnotations QQmlJSStorageGeneralizer::run(
- InstructionAnnotations annotations, Function *function,
- QQmlJS::DiagnosticMessage *error)
+QQmlJSCompilePass::BlocksAndAnnotations
+QQmlJSStorageGeneralizer::run(Function *function, QQmlJS::DiagnosticMessage *error)
{
m_error = error;
@@ -32,7 +31,7 @@ QQmlJSCompilePass::InstructionAnnotations QQmlJSStorageGeneralizer::run(
} else {
setError(QStringLiteral("Cannot store the return type %1.")
.arg(returnType->internalName(), 0));
- return InstructionAnnotations();
+ return {};
}
}
@@ -53,12 +52,12 @@ QQmlJSCompilePass::InstructionAnnotations QQmlJSStorageGeneralizer::run(
transformRegister(argument);
}
- for (auto i = annotations.begin(), iEnd = annotations.end(); i != iEnd; ++i) {
+ for (auto i = m_annotations.begin(), iEnd = m_annotations.end(); i != iEnd; ++i) {
transformRegister(i->second.changedRegister);
transformRegisters(i->second.typeConversions);
}
- return annotations;
+ return { std::move(m_basicBlocks), std::move(m_annotations) };
}
QT_END_NAMESPACE