summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2023-03-08 15:12:17 +0100
committerLuca Di Sera <luca.disera@qt.io>2023-03-09 10:57:25 +0100
commitdea4c2e7bd19747594adaedc171fbb7e8e04d6a6 (patch)
treebe90ebd44b61688d00ab742743827e93db514a3d
parent4b92acd101766af02257319a94598f49b0a55bf9 (diff)
downloadqttools-dea4c2e7bd19747594adaedc171fbb7e8e04d6a6.tar.gz
QDoc: Move `CodeParser::precompileHeaders` to `ClangCodeParser`
QDoc parses a series of source file in different languages and formats to find the user-provided documentation. The base parsing interface for elements that perform this process is given by the `CodeParser` class, with the concrete implementation of the process for different languages/formats give by its child classes. `CodeParser`, as part of its interface, provides certain methods that are only meaningful when processing specific programming languages source. For example, it exposes `CodeParser::precompileHeaders` whose purpose it to provide a PCH for parsing C++ source files. The method is only implemented and used in the `ClangCodeParser` child class, the class that actually implements the processing of C++ source files. Hence, the method is now removed from `CodeParser`'s interface and directly exposed as part of the interface of `ClangCodeParser`, to reduce the surface of the method and to reduce the dependencies between `ClangCodeParser` and the `CodeParser` interface, which is generally expected to be removed in the future. Change-Id: I243b81974c741589e7f644e1996cdb274e20502b Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r--src/qdoc/clangcodeparser.h2
-rw-r--r--src/qdoc/codeparser.h1
2 files changed, 1 insertions, 2 deletions
diff --git a/src/qdoc/clangcodeparser.h b/src/qdoc/clangcodeparser.h
index 3aa2f9a79..30d639f9f 100644
--- a/src/qdoc/clangcodeparser.h
+++ b/src/qdoc/clangcodeparser.h
@@ -24,7 +24,7 @@ public:
QStringList sourceFileNameFilter() override;
void parseHeaderFile(const Location &location, const QString &filePath) override;
void parseSourceFile(const Location &location, const QString &filePath) override;
- void precompileHeaders() override;
+ void precompileHeaders();
Node *parseFnArg(const Location &location, const QString &fnSignature, const QString &idTag) override;
static const QByteArray &fn() { return s_fn; }
diff --git a/src/qdoc/codeparser.h b/src/qdoc/codeparser.h
index 76d9daf10..ebd433dae 100644
--- a/src/qdoc/codeparser.h
+++ b/src/qdoc/codeparser.h
@@ -27,7 +27,6 @@ public:
virtual QStringList sourceFileNameFilter() = 0;
virtual void parseHeaderFile(const Location &location, const QString &filePath);
virtual void parseSourceFile(const Location &location, const QString &filePath) = 0;
- virtual void precompileHeaders() {}
virtual Node *parseFnArg(const Location &, const QString &, const QString & = QString())
{
return nullptr;