aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/DependencyFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/DependencyFile.cpp')
-rw-r--r--clang/lib/Frontend/DependencyFile.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp
index ccc7ed9..2888273 100644
--- a/clang/lib/Frontend/DependencyFile.cpp
+++ b/clang/lib/Frontend/DependencyFile.cpp
@@ -141,7 +141,18 @@ void DependencyCollector::maybeAddDependency(StringRef Filename,
}
bool DependencyCollector::addDependency(StringRef Filename) {
- if (Seen.insert(Filename).second) {
+ StringRef SearchPath;
+#ifdef _WIN32
+ // Make the search insensitive to case and separators.
+ llvm::SmallString<256> TmpPath = Filename;
+ llvm::sys::path::native(TmpPath);
+ std::transform(TmpPath.begin(), TmpPath.end(), TmpPath.begin(), ::tolower);
+ SearchPath = TmpPath.str();
+#else
+ SearchPath = Filename;
+#endif
+
+ if (Seen.insert(SearchPath).second) {
Dependencies.push_back(std::string(Filename));
return true;
}