[cfe-commits] r132539 - /cfe/trunk/lib/Basic/FileManager.cpp
Francois Pichet
pichet2000 at gmail.com
Fri Jun 3 02:44:29 PDT 2011
Author: fpichet
Date: Fri Jun 3 04:44:29 2011
New Revision: 132539
URL: http://llvm.org/viewvc/llvm-project?rev=132539&view=rev
Log:
My testing shows that function stat has no problem with trailing separators. (tested on Windows and Darwin).
This fixes a bug on Windows:
clang c:\test.cpp
Here the call stat("c:") is not recognized as a directory (must be "c:\").
Modified:
cfe/trunk/lib/Basic/FileManager.cpp
Modified: cfe/trunk/lib/Basic/FileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=132539&r1=132538&r2=132539&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileManager.cpp (original)
+++ cfe/trunk/lib/Basic/FileManager.cpp Fri Jun 3 04:44:29 2011
@@ -264,10 +264,6 @@
/// exist.
///
const DirectoryEntry *FileManager::getDirectory(llvm::StringRef DirName) {
- // stat doesn't like trailing separators (at least on Windows).
- if (DirName.size() > 1 && llvm::sys::path::is_separator(DirName.back()))
- DirName = DirName.substr(0, DirName.size()-1);
-
++NumDirLookups;
llvm::StringMapEntry<DirectoryEntry *> &NamedDirEnt =
SeenDirEntries.GetOrCreateValue(DirName);
More information about the cfe-commits
mailing list