ClangTools: Add automatic clang tool runner for open documents

Fixes: QTCREATORBUG-23349
Change-Id: I81197180c9d69c7df6184f8fcbf05f2256eaf7f6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
David Schulz
2020-07-22 14:52:06 +02:00
parent 7f562c4d33
commit e176958da1
24 changed files with 781 additions and 79 deletions

View File

@@ -75,7 +75,15 @@ void ClangToolRunner::init(const QString &outputDirPath,
ClangToolRunner::~ClangToolRunner()
{
Utils::SynchronousProcess::stopProcess(m_process);
if (m_process.state() != QProcess::NotRunning) {
// asking politly to terminate costs ~300 ms on windows so skip the courtasy and direct kill the process
if (Utils::HostOsInfo::isWindowsHost()) {
m_process.kill();
m_process.waitForFinished(100);
} else {
Utils::SynchronousProcess::stopProcess(m_process);
}
}
}
static QString createOutputFilePath(const QString &dirPath, const QString &fileToAnalyze)