[cfe-commits] r146154 - /cfe/trunk/lib/Lex/ModuleMap.cpp

Douglas Gregor dgregor at apple.com
Thu Dec 8 08:13:25 PST 2011


Author: dgregor
Date: Thu Dec  8 10:13:24 2011
New Revision: 146154

URL: http://llvm.org/viewvc/llvm-project?rev=146154&view=rev
Log:
Convert paths to native format before constructing a
directory_iterator for them.

Modified:
    cfe/trunk/lib/Lex/ModuleMap.cpp

Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=146154&r1=146153&r2=146154&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Thu Dec  8 10:13:24 2011
@@ -273,10 +273,14 @@
   
   // Look for subframeworks.
   llvm::error_code EC;
-  llvm::SmallString<128> SubframeworksDirName = StringRef(FrameworkDir->getName());
+  llvm::SmallString<128> SubframeworksDirName
+    = StringRef(FrameworkDir->getName());
   llvm::sys::path::append(SubframeworksDirName, "Frameworks");
-  for (llvm::sys::fs::directory_iterator Dir(SubframeworksDirName.str(), EC),
-                                         DirEnd;
+  llvm::SmallString<128> SubframeworksDirNameNative;
+  llvm::sys::path::native(SubframeworksDirName.str(),
+                          SubframeworksDirNameNative);
+  for (llvm::sys::fs::directory_iterator 
+         Dir(SubframeworksDirNameNative.str(), EC), DirEnd;
        Dir != DirEnd && !EC; Dir.increment(EC)) {
     if (!StringRef(Dir->path()).endswith(".framework"))
       continue;
@@ -293,8 +297,11 @@
   Module *ModulePrivate = 0;
   llvm::SmallString<128> PrivateHeadersDirName(FrameworkDir->getName());
   llvm::sys::path::append(PrivateHeadersDirName, "PrivateHeaders");
-  for (llvm::sys::fs::directory_iterator Dir(PrivateHeadersDirName.str(), EC),
-       DirEnd;
+  llvm::SmallString<128> PrivateHeadersDirNameNative;
+  llvm::sys::path::native(PrivateHeadersDirName.str(),
+                          PrivateHeadersDirNameNative);
+  for (llvm::sys::fs::directory_iterator 
+         Dir(PrivateHeadersDirNameNative.str(), EC), DirEnd;
        Dir != DirEnd && !EC; Dir.increment(EC)) {
     // Check whether this entry has an extension typically associated with 
     // headers.





More information about the cfe-commits mailing list