forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/5.0'
Conflicts: src/plugins/clangtools/clangtoolssettings.cpp src/plugins/clangtools/executableinfo.cpp src/plugins/clangtools/executableinfo.h Change-Id: Id8caf63e3e594792467d3447870086bd2d8f73b9
This commit is contained in:
@@ -163,6 +163,22 @@ ClangTidyInfo::ClangTidyInfo(const FilePath &executablePath)
|
||||
, supportedChecks(queryClangTidyChecks(executablePath, "-checks=*"))
|
||||
{}
|
||||
|
||||
ClazyStandaloneInfo ClazyStandaloneInfo::getInfo(const FilePath &executablePath)
|
||||
{
|
||||
const QDateTime timeStamp = executablePath.lastModified();
|
||||
const auto it = cache.find(executablePath);
|
||||
if (it == cache.end()) {
|
||||
const ClazyStandaloneInfo info(executablePath);
|
||||
cache.insert(executablePath, qMakePair(timeStamp, info));
|
||||
return info;
|
||||
}
|
||||
if (it->first != timeStamp) {
|
||||
it->first = timeStamp;
|
||||
it->second = ClazyStandaloneInfo::getInfo(executablePath);
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
||||
ClazyStandaloneInfo::ClazyStandaloneInfo(const FilePath &executablePath)
|
||||
: defaultChecks(queryClangTidyChecks(executablePath, {})) // Yup, behaves as clang-tidy.
|
||||
, supportedChecks(querySupportedClazyChecks(executablePath))
|
||||
@@ -228,5 +244,7 @@ QPair<FilePath, QString> getClangIncludeDirAndVersion(const FilePath &clangToolP
|
||||
return qMakePair(dynamicResourceDir + "/include", dynamicVersion);
|
||||
}
|
||||
|
||||
QHash<Utils::FilePath, QPair<QDateTime, ClazyStandaloneInfo>> ClazyStandaloneInfo::cache;
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ClangTools
|
||||
|
||||
Reference in New Issue
Block a user