diff --git a/src/plugins/clangtools/clangtoolruncontrol.cpp b/src/plugins/clangtools/clangtoolruncontrol.cpp index c684774ef8d..7881b53916f 100644 --- a/src/plugins/clangtools/clangtoolruncontrol.cpp +++ b/src/plugins/clangtools/clangtoolruncontrol.cpp @@ -165,24 +165,23 @@ void ClangToolRunWorker::start() .arg(toolName, projectFile.toUserOutput(), m_diagnosticConfig.displayName()), Utils::NormalMessageFormat); - // Collect files - const auto [includeDir, clangVersion] - = getClangIncludeDirAndVersion(runControl()->commandLine().executable()); + const ClangToolType tool = m_tool == ClangTidyTool::instance() ? ClangToolType::Tidy + : ClangToolType::Clazy; + const FilePath executable = toolExecutable(tool); + const auto [includeDir, clangVersion] = getClangIncludeDirAndVersion(executable); + // Collect files AnalyzeUnits unitsToProcess; for (const FileInfo &fileInfo : m_fileInfos) unitsToProcess.append({fileInfo, includeDir, clangVersion}); - qCDebug(LOG) << Q_FUNC_INFO << runControl()->commandLine().executable() - << includeDir << clangVersion; + qCDebug(LOG) << Q_FUNC_INFO << executable << includeDir << clangVersion; qCDebug(LOG) << "Files to process:" << unitsToProcess; qCDebug(LOG) << "Environment:" << m_environment; m_filesAnalyzed.clear(); m_filesNotAnalyzed.clear(); - const ClangToolType tool = m_tool == ClangTidyTool::instance() ? ClangToolType::Tidy - : ClangToolType::Clazy; using namespace Tasking; QList tasks{ParallelLimit(qMax(1, m_runSettings.parallelJobs()))}; for (const AnalyzeUnit &unit : std::as_const(unitsToProcess)) { diff --git a/src/plugins/clangtools/executableinfo.cpp b/src/plugins/clangtools/executableinfo.cpp index 643b7afe00c..1e280a68894 100644 --- a/src/plugins/clangtools/executableinfo.cpp +++ b/src/plugins/clangtools/executableinfo.cpp @@ -225,6 +225,7 @@ static QPair clangIncludeDirAndVersion(const FilePath &clangT QPair getClangIncludeDirAndVersion(const FilePath &clangToolPath) { + QTC_CHECK(!clangToolPath.isEmpty()); static QMap> cache; auto it = cache.find(clangToolPath); if (it == cache.end())