ClangTools: use VFSoverlay if the clang tool supports it

check the help output of a clang tool whether virtual file
system overlay is supported. Prepares for the vfso support
of clazy-standalone.

Change-Id: I157c94de1dda41c83945c9bc8a4c2e132b2e6551
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-08-25 06:18:26 +02:00
parent 43ee53c233
commit 7bbbdeac52
4 changed files with 33 additions and 24 deletions

View File

@@ -186,7 +186,7 @@ void DocumentClangToolRunner::run()
return createRunner<ClangTidyRunner>(config, env);
};
}
if (config.isClazyEnabled() && !m_document->isModified()) {
if (config.isClazyEnabled()) {
m_runnerCreators << [this, env, config]() {
return createRunner<ClazyStandaloneRunner>(config, env);
};
@@ -218,7 +218,8 @@ void DocumentClangToolRunner::runNext()
auto [clangIncludeDir, clangVersion] = getClangIncludeDirAndVersion(m_currentRunner.get());
qCDebug(LOG) << Q_FUNC_INFO << m_currentRunner->executable() << clangIncludeDir
<< clangVersion << m_fileInfo.file;
if (clangIncludeDir.isEmpty() || clangVersion.isEmpty()) {
if (clangIncludeDir.isEmpty() || clangVersion.isEmpty()
|| (m_document->isModified() && !m_currentRunner->supportsVFSOverlay())) {
runNext();
} else {
AnalyzeUnit unit(m_fileInfo, clangIncludeDir, clangVersion);