aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljslintercodegen.cpp
diff options
context:
space:
mode:
authorOlivier De Cannière <olivier.decanniere@qt.io>2024-03-04 09:45:34 +0100
committerOlivier De Cannière <olivier.decanniere@qt.io>2024-04-19 20:00:56 +0200
commit4619377409f28f35cfd9bf0f6ed2bd1094e66c16 (patch)
tree1a6ff446c04120e25797af4b4ddca29fc6ea11c6 /src/qmlcompiler/qqmljslintercodegen.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 <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljslintercodegen.cpp')
-rw-r--r--src/qmlcompiler/qqmljslintercodegen.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qmlcompiler/qqmljslintercodegen.cpp b/src/qmlcompiler/qqmljslintercodegen.cpp
index 2b79e34efa..175f7ee1e0 100644
--- a/src/qmlcompiler/qqmljslintercodegen.cpp
+++ b/src/qmlcompiler/qqmljslintercodegen.cpp
@@ -83,16 +83,18 @@ bool QQmlJSLinterCodegen::analyzeFunction(const QV4::Compiler::Context *context,
QQmlJS::DiagnosticMessage *error)
{
QQmlJSTypePropagator propagator(m_unitGenerator, &m_typeResolver, m_logger,
- m_passManager);
- QQmlJSCompilePass::InstructionAnnotations annotations = propagator.run(function, error);
+ {}, {}, m_passManager);
+ auto [basicBlocks, annotations] = propagator.run(function, error);
if (!error->isValid()) {
- QQmlJSShadowCheck shadowCheck(m_unitGenerator, &m_typeResolver, m_logger);
- shadowCheck.run(&annotations, function, error);
+ QQmlJSShadowCheck shadowCheck(m_unitGenerator, &m_typeResolver, m_logger, basicBlocks,
+ annotations);
+ shadowCheck.run(function, error);
}
if (!error->isValid()) {
- QQmlJSStorageGeneralizer generalizer(m_unitGenerator, &m_typeResolver, m_logger);
- generalizer.run(annotations, function, error);
+ QQmlJSStorageGeneralizer generalizer(m_unitGenerator, &m_typeResolver, m_logger,
+ basicBlocks, annotations);
+ generalizer.run(function, error);
}
if (error->isValid()) {