aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-23 23:50:42 +0000
committerChris Lattner <sabre@nondot.org>2010-08-23 23:50:42 +0000
commitc070da46b896940aa2cbac416e5a2f8eee22d7d8 (patch)
tree43b4d4e7ada1b0fab5282dd025d14cf2676217da /lib/Basic/FileManager.cpp
parentb556db435fb1ad2a15580aada1cba0ae6da1c4cb (diff)
fix PR7953 - Windows filename are case insensitive:
#pragma once wasn't working on win32 if the header file was included using a different case. I tracked down the problem to the fact that clang::FileManager was caching files using case sensitive string (UniqueFiles) on Windows. I changed FileManager to cache filename in lower case only. Doesn't affect UNIX because UNIX uses Inode to uniquely identify files. unix doesn't use this codepath. Analysis and patch by Francois Pichet! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/FileManager.cpp')
-rw-r--r--lib/Basic/FileManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp
index aa175cb1a6..565f8a61de 100644
--- a/lib/Basic/FileManager.cpp
+++ b/lib/Basic/FileManager.cpp
@@ -19,6 +19,7 @@
#include "clang/Basic/FileManager.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/System/Path.h"
#include "llvm/Config/config.h"
@@ -83,6 +84,9 @@ class FileManager::UniqueFileContainer {
public:
FileEntry &getFile(const char *Name, struct stat &StatBuf) {
std::string FullPath(GetFullPath(Name));
+
+ // LowercaseString because Windows filesystem is case insensitive.
+ FullPath = llvm::LowercaseString(FullPath);
return UniqueFiles.GetOrCreateValue(
FullPath.c_str(),
FullPath.c_str() + FullPath.size()