aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangtools/clangtoolrunner.cpp
diff options
context:
space:
mode:
authorJarek Kobus <[email protected]>2023-01-11 20:15:33 +0100
committerJarek Kobus <[email protected]>2023-01-12 09:24:50 +0000
commit64b9728a689c41eed376ccfe6582f375a3a3158a (patch)
tree08760261a466eeaf62d003421a140e7bbf19539a /src/plugins/clangtools/clangtoolrunner.cpp
parent5dec97ea4121a8253f6d89d99e5165eb333e50a0 (diff)
ClangToolsUtils: Add isVFSOverlaySupported()
Remove ClangToolRunner::supportsVFSOverlay(). Move check for modified document and vfsOverlay into runner creator method, as it's called in the same cycle just before the runner is about to be started. Change-Id: I7a5df71bfa73c350862e4c7f9eae49773b6206b7 Reviewed-by: David Schulz <[email protected]>
Diffstat (limited to 'src/plugins/clangtools/clangtoolrunner.cpp')
-rw-r--r--src/plugins/clangtools/clangtoolrunner.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/plugins/clangtools/clangtoolrunner.cpp b/src/plugins/clangtools/clangtoolrunner.cpp
index 59f8d4c322b..fcb310c07df 100644
--- a/src/plugins/clangtools/clangtoolrunner.cpp
+++ b/src/plugins/clangtools/clangtoolrunner.cpp
@@ -103,25 +103,12 @@ QStringList ClangToolRunner::mainToolArguments() const
{
QStringList result;
result << "-export-fixes=" + m_outputFilePath;
- if (!m_input.overlayFilePath.isEmpty() && supportsVFSOverlay())
+ if (!m_input.overlayFilePath.isEmpty() && isVFSOverlaySupported(m_executable))
result << "--vfsoverlay=" + m_input.overlayFilePath;
result << QDir::toNativeSeparators(m_input.unit.file);
return result;
}
-bool ClangToolRunner::supportsVFSOverlay() const
-{
- static QMap<FilePath, bool> vfsCapabilities;
- auto it = vfsCapabilities.find(m_executable);
- if (it == vfsCapabilities.end()) {
- QtcProcess p;
- p.setCommand({m_executable, {"--help"}});
- p.runBlocking();
- it = vfsCapabilities.insert(m_executable, p.allOutput().contains("vfsoverlay"));
- }
- return it.value();
-}
-
static QString createOutputFilePath(const FilePath &dirPath, const QString &fileToAnalyze)
{
const QString fileName = QFileInfo(fileToAnalyze).fileName();