| 1 | // Copyright (C) 2024 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
| 3 | |
| 4 | #ifndef QQMLJSSTORAGEINITIALIZER_P_H |
| 5 | #define QQMLJSSTORAGEINITIALIZER_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | |
| 17 | #include <private/qqmljscompilepass_p.h> |
| 18 | |
| 19 | QT_BEGIN_NAMESPACE |
| 20 | |
| 21 | class Q_QMLCOMPILER_EXPORT QQmlJSStorageInitializer : public QQmlJSCompilePass |
| 22 | { |
| 23 | public: |
| 24 | QQmlJSStorageInitializer(const QV4::Compiler::JSUnitGenerator *jsUnitGenerator, |
| 25 | const QQmlJSTypeResolver *typeResolver, QQmlJSLogger *logger, |
| 26 | const BasicBlocks &basicBlocks, |
| 27 | const InstructionAnnotations &annotations) |
| 28 | : QQmlJSCompilePass(jsUnitGenerator, typeResolver, logger, basicBlocks, annotations) |
| 29 | {} |
| 30 | |
| 31 | BlocksAndAnnotations run(Function *function); |
| 32 | |
| 33 | protected: |
| 34 | // We don't have to use the byte code here. We only transform the instruction annotations. |
| 35 | Verdict startInstruction(QV4::Moth::Instr::Type) override { return SkipInstruction; } |
| 36 | void endInstruction(QV4::Moth::Instr::Type) override {} |
| 37 | }; |
| 38 | |
| 39 | QT_END_NAMESPACE |
| 40 | |
| 41 | #endif // QQMLJSSTORAGEINITIALIZER_P_H |
| 42 |
