diff options
author | Luca Di Sera <luca.disera@qt.io> | 2023-03-24 14:09:46 +0100 |
---|---|---|
committer | Luca Di Sera <luca.disera@qt.io> | 2023-03-27 11:45:05 +0100 |
commit | dbd68d439b17f8d3daa253256b3b79e053b01131 (patch) | |
tree | d04b5a1485f91896b110a77539d26d7819928b0f /src/qdoc/clangcodeparser.cpp | |
parent | f6291e2163c96e9c6d15c0ac52a8313c4580cb8d (diff) | |
download | qttools-dbd68d439b17f8d3daa253256b3b79e053b01131.tar.gz |
QDoc: Remove `QmlCodeParser::m_engine`
As part of producing a documentation set, QDoc parses a series of
user-defined input source files in various languages to extract the
user-provided documentation and certain source-code level elements.
For QML source files, the `QmlCodeParser` class is used, taking care of
reading the QML code and build an internal representation for some of
its elements.
`QmlCodeParser` uses the `QQmlJs` parsing api to do so.
As part of using the `QQmlJs` parsing api, `QmlCodeParser` has to build
a `QQmlJs::Engine`, `QQmlJs::Lexer` and `QQmlJsEngine::Parser`.
Currently, `QmlCodeParser` stores the engine element as
an instance member, `m_engine`.
Supposedly, this is intended as a way to avoid building the element more
than once.
Building a `QQmlJs::Engine` more than once does not provide any
meaningful overhead, moreover not in the code path where it is used.
Furthermore, `m_engine` is used only a few times, in
`QmlCodeParser::parseSourceFile`, the entry point for parsing a QML
source file.
Hence, to reduce the scope of `m_engine` and avoid requiring an
out-of-scope initialization for it, `m_engine` is now removed in favor
of a local instance in `QmlCodeParser::parseSourceFile`.
Change-Id: I73f23ec06c1fa3ba3fe50ff4dffc9ff9229c114d
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
0 files changed, 0 insertions, 0 deletions