llvm::SmallVector<DotClangTidyCache *> Caches;
{
std::lock_guard<std::mutex> Lock(Mu);
- for (auto I = path::begin(Parent, path::Style::posix),
- E = path::end(Parent);
- I != E; ++I) {
+ for (auto I = path::begin(Parent), E = path::end(Parent); I != E; ++I) {
assert(I->end() >= Parent.begin() && I->end() <= Parent.end() &&
"Canonical path components should be substrings");
llvm::StringRef Ancestor(Parent.begin(), I->end() - Parent.begin());
+#ifdef _WIN32
+ // C:\ is an ancestor, but skip its (relative!) parent C:.
+ if (Ancestor.size() == 2 && Ancestor.back() == ':')
+ continue;
+#endif
+ assert(path::is_absolute(Ancestor));
+
auto It = Cache.find(Ancestor);
// Assemble the actual config file path only if needed.