summaryrefslogtreecommitdiff
path: root/src/qdoc/clangcodeparser.h
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2018-10-01 10:59:48 +0200
committerMartin Smith <martin.smith@qt.io>2018-10-23 14:15:29 +0000
commitc4d02e5cea9f8657bd74f1f724d048de5c0142b1 (patch)
tree704477c141bfe18b25233a065f871701e099b5e6 /src/qdoc/clangcodeparser.h
parentfcdb57ed07d36b0b72f41da974550f505a162077 (diff)
downloadqttools-c4d02e5cea9f8657bd74f1f724d048de5c0142b1.tar.gz
qdoc: Let qdoc print better log messages
This change enables qdoc to print better log messages. A new logging function is added to Location, where the qdoc error and warning functions are located. The new function is logToStdErrAlways(msg). It always formats msg for output to stderr by prepending the current time and the word LOG. Several LOG messages are now sent to stderr. Also, qdoc now always tells clang to output its parsing errors to stderr during the building of the precompiled header in the prepare phase. These clang parser errors are easily identified in the new LOG. When no include paths are passed to qdoc on the command line, which is the case for QtPlatformHeaders, qdoc guesses some reasonable include paths from the information available and passes them to clang. It works ok for the QtPlatformHeaders module. However, clang gets lost in some NSOpenGL headers and prints quite a lot of useless parse errors, so we arbitrarily turn off clang's parse errors whenever qdoc has to guess the include paths. The guessed include paths are printed in the LOG, and a warning that clang does not print parse errors when the include paths are guessed is also printed in LOG. Change-Id: I8e5bd0cc5b27463c4c85c9cdcc01b030ac03a1c1 Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.h')
-rw-r--r--src/qdoc/clangcodeparser.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qdoc/clangcodeparser.h b/src/qdoc/clangcodeparser.h
index b70fcc0e8..b3497608d 100644
--- a/src/qdoc/clangcodeparser.h
+++ b/src/qdoc/clangcodeparser.h
@@ -69,6 +69,7 @@ public:
void buildPCH();
private:
+ int printParsingErrors_;
QHash<QString, QString> allHeaders_; // file name->path
QVector<QByteArray> includePaths_;
QScopedPointer<QTemporaryDir> pchFileDir_;